You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This specific false positive happens if a constructor creates a callback/closure, and that closure calls a method which accesses the readonly property.
These are the full requirements for the bug to be seen:
A class has a readonly property.
The property is set in the constructor.
A method accesses that property.
A callback/closure which calls the method is created in the constructor.
This bug started with version 1.10.23 and is still being reported with the latest version. The error isn't reported in earlier versions.
Bug report
This specific false positive happens if a constructor creates a callback/closure, and that closure calls a method which accesses the readonly property.
These are the full requirements for the bug to be seen:
This bug started with version
1.10.23
and is still being reported with the latest version. The error isn't reported in earlier versions.Code snippet that reproduces the problem
https://phpstan.org/r/9590d157-89fd-4d1f-8290-a7af4f82d461
Expected output
PHP shouldn't report an error.
Did PHPStan help you today? Did it make you happy in any way?
PHPStan has been a huge help, it's great at finding bugs as part of our CICD system!
The text was updated successfully, but these errors were encountered: