-
-
Notifications
You must be signed in to change notification settings - Fork 867
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
Anonymous class phpdoc is not parsed #7345
Comments
|
I'm getting |
might be a different error since its not on an anonymous class. here's a playground for it. |
@neclimdul After the latest commit in 1.8.x, PHPStan now reports different result with your code snippet: @@ @@
-6: Attribute class AllowDynamicProperties does not exist.
+No errors |
php/php-src#12909 - phpdoc can be currently defined "more above than the anonymous class directly", but attributes must be declared "above the anonymous class directly only". |
After closer inspection, this works as expected: https://phpstan.org/r/a670d04c-fd9f-4650-986d-30651e8dbf6f |
@ondrejmirtes as explained in the php-src issue and in https://3v4l.org/W4cjH, |
@mvorisek No, the PHPDoc needs to be directly above the class for PHPStan to see it. I don't consider this a bug. |
PHP works some way. PHPstan should parse the phpdoc from exactly the same places as |
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
the php recognizes the phpdoc class comment correctly and all code that relies on phpdoc annotation too, so I submit it as a bug
https://3v4l.org/W4cjH
real usecase/testcase https://github.com/mvorisek/atk4-hintable-mirror/blob/24951ac3d1a0a4a9beb7a8ed6c5790ea76a4176e/tests/Data/HintableModelArrayTest.php#L62-L84
Code snippet that reproduces the problem
https://phpstan.org/r/02bc0432-1c81-4868-95ae-cd1d4b276578
Expected output
no error
The text was updated successfully, but these errors were encountered: