We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
See https://phpstan.org/r/c93e00ea-82a6-484a-b1e6-ac2a4f443693
The in_array() warning is wrong there at the end, as 10 may or may not be inside array{0: 10|20, 1?: 20} (which could be array{0: 20} for example.
10
array{0: 10|20, 1?: 20}
array{0: 20}
In case it's more readable or to understand what the code does it comes from https://github.com/composer/composer/blob/6be6ce7d9f911c248139976703b73f4876c8a38f/src/Composer/Downloader/PathDownloader.php#L254-L279 originally.
The text was updated successfully, but these errors were encountered:
@Seldaek After the latest push in 1.8.x, PHPStan now reports different result with your code snippet:
@@ @@ -17: Dumped type: array{0: 10|20, 1?: 20} +17: Dumped type: array{0: 10, 1?: 20}|array{20} 18: Dumped type: 10|20 -21: Dumped type: array{0: 10|20, 1?: 20} -22: Dumped type: 10 -23: Call to function in_array() with arguments 20, array{0: 10|20, 1?: 20} and true will always evaluate to true. +21: Dumped type: array{0: 10, 1?: 20}|array{20} +22: Dumped type: 10
Dumped type: 10
Sorry, something went wrong.
phpstan/phpstan-src@7aa45bc
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
No branches or pull requests
See https://phpstan.org/r/c93e00ea-82a6-484a-b1e6-ac2a4f443693
The in_array() warning is wrong there at the end, as
10
may or may not be insidearray{0: 10|20, 1?: 20}
(which could bearray{0: 20}
for example.In case it's more readable or to understand what the code does it comes from https://github.com/composer/composer/blob/6be6ce7d9f911c248139976703b73f4876c8a38f/src/Composer/Downloader/PathDownloader.php#L254-L279 originally.
The text was updated successfully, but these errors were encountered: