-
-
Notifications
You must be signed in to change notification settings - Fork 921
Access to internal constant from the same package/class #13041
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
Comments
I think the issue is that you're missing a |
Interesting. I isolated it from code which had namespace... So in this issue let's focus if the class is the same, with |
Not sure to understand. You should give a real example with namespaces then. |
In simple words, https://phpstan.org/r/6e30fb04-d096-42d1-a0b5-7d0672c9c684 (repro from description) should not report any error. The class is not namespaced, but the access is withing the same class, thus internal access is fine. I mean the NS for computing "root NS" should be computed from the NS incl. class name, ie. "root NS" for the declaration and the access would be "HelloWorld". This only an idea for possible implementation. |
Then does phpstan/phpstan-src#3998 solve your issue ? |
That is exactly perfect, thank you! ❤ |
Bug report
Internal access from the same class/root package should be allowed.
Code snippet that reproduces the problem
https://phpstan.org/r/6e30fb04-d096-42d1-a0b5-7d0672c9c684
Expected output
no error
The text was updated successfully, but these errors were encountered: