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
Using @phpstan-ignore-line after already ignored line fails #3563
Comments
@davidbrnovjak After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
6: Else branch is unreachable because ternary operator condition is always true.
-6: Strict comparison using !== between array() and false will always evaluate to true.
+6: Strict comparison using !== between array{} and false will always evaluate to true. Full report
|
@davidbrnovjak After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
7: Else branch is unreachable because ternary operator condition is always true.
-7: Strict comparison using !== between array() and false will always evaluate to true.
+7: Strict comparison using !== between array{} and false will always evaluate to true. Full report
|
Is it possible that this is PHP-Parser bug? The Also in the above case, none of the nodes have Shorter code to reproduce: <?php
array_merge(
[], // First comment
[], // Second comment
); |
@canvural Yeah, Nikita told me to read the comments directly from tokens: nikic/PHP-Parser#742 |
nikic/PHP-Parser#791 maybe. |
@davidbrnovjak After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-6: Else branch is unreachable because ternary operator condition is always true.
-6: Strict comparison using !== between array() and false will always evaluate to true.
+No errors |
@davidbrnovjak After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-7: Else branch is unreachable because ternary operator condition is always true.
-7: Strict comparison using !== between array() and false will always evaluate to true.
+No errors |
Fixed: phpstan/phpstan-src@9474696 |
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. |
Bug report
Trying to ignore one line in code with
@phpstan-ignore-line
fails if previous line was already marked to ignore.Code snippet that reproduces the problem
Using two
@phpstan-ignore-line
doesn’t workhttps://phpstan.org/r/fbb053a0-9a30-4167-8385-cee47c509f9e
Using
@phpstan-ignore-line
after@phpstan-ignore-next-line
doesn’t work eitherhttps://phpstan.org/r/b73c58e0-22df-4e54-80c4-27311e7a091b
But using
@phpstan-ignore-next-line
workshttps://phpstan.org/r/ebc7d3f9-d031-4793-8fb6-35e8564df7c1
Bug or feature? :)
Expected output
Both lines should be ignored
The text was updated successfully, but these errors were encountered: