New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use strpos
instead of str_contains
#7220
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,6 @@ | |
use function in_array; | ||
use function mt_rand; | ||
use function reset; | ||
use function str_contains; | ||
use function strpos; | ||
use function substr; | ||
|
||
|
@@ -505,7 +504,7 @@ public static function getReturnTypeFromMappingIds( | |
public static function cleanContext(Context $context, int $fake_var_discriminator): void | ||
{ | ||
foreach ($context->vars_in_scope as $var_in_scope => $_) { | ||
if (str_contains($var_in_scope, "__fake_{$fake_var_discriminator}_")) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Psalm did not pick that up? Polyfills are messing with the analysis maybe? I wonder how hard it could be to add a new config forbidPolyfills that, when enabled would warn about functions removed through deltas but defined elsewhere... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Reflection, likely. |
||
if (strpos($var_in_scope, "__fake_{$fake_var_discriminator}_") !== false) { | ||
unset($context->vars_in_scope[$var_in_scope]); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those two could probably removed. AFAIK, they're not in CI anymore...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
collections
is used:psalm/.circleci/config.yml
Lines 68 to 76 in aa7e400