Skip to content
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

Merged
merged 3 commits into from Dec 26, 2021
Merged

Conversation

weirdan
Copy link
Collaborator

@weirdan weirdan commented Dec 26, 2021

Fixes #7219 (str_contains was added in PHP 8)

Fixes vimeo#7219 (str_contains was added in PHP 8)
@weirdan weirdan added the release:fix The PR will be included in 'Fixes' section of the release notes label Dec 26, 2021
@weirdan weirdan merged commit aa7e400 into vimeo:master Dec 26, 2021
@weirdan weirdan deleted the upstream-master branch December 26, 2021 08:17
@@ -22,8 +22,8 @@ phpunit)
;;

collections)
git clone --depth=1 git@github.com:muglug/collections.git
cd collections
git clone --depth=1 git@github.com:psalm/endtoend-test-collections.git
Copy link
Collaborator

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...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collections is used:

- run:
name: Analyse PHPUnit
command: bin/test-with-real-projects.sh phpunit
- run:
name: Analyse Psl
command: bin/test-with-real-projects.sh psl
- run:
name: Analyse Collections
command: bin/test-with-real-projects.sh collections

@@ -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}_")) {
Copy link
Collaborator

Choose a reason for hiding this comment

The 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...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Polyfills are messing with the analysis maybe?

Reflection, likely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix The PR will be included in 'Fixes' section of the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uncaught Exception: Error Call to undefined function str_contains()
2 participants