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

Detect array_rand second parameter #2633

Merged
merged 4 commits into from Sep 28, 2023
Merged

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Sep 20, 2023

if ($random == 1)
$keys = array(array_rand($array));
else
$keys = array_rand($array, $random);
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice to sprinkle some assertType calls here, and reference it from NodeScopeResolverTest.

And please add { ... } around those if and else. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@ondrejmirtes ondrejmirtes merged commit 3f9f67d into phpstan:1.10.x Sep 28, 2023
414 of 416 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants