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
@phpstan-ignore-line not working on last array line #4759
Comments
This bug report is missing a link to reproduction on phpstan.org. It will most likely be closed after manual review. |
Link to reproduction : https://phpstan.org/r/c34b3c94-72d4-44ab-a8ed-a883afd57af7 |
I belive this is duplicate of #4750 |
@WillyReyno After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
- 9: Access to an undefined property object::$b.
-13: Access to an undefined property object::$a.
+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
When trying to ignore a few specific lines within an array I noticed that
// @phpstan-ignore-line
was not working if my array contained only one key or if the key I was trying to ignore was the last one.Code snippet that reproduces the problem
Last key not ignored
The following code where
$a
&$c
dont exist on$device
PHPStan only ignores
$a
while$c
should also have been ignored.Only key not ignored
PHPStan reports :
Expected output
PHPStan shouldn't have reported the ignored lines.
The text was updated successfully, but these errors were encountered: