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
Non-literal parameter default parsing incorrectly adding NULL to parameter types #3629
Comments
Changing the default in the phpstorm stubs to a literal (f.e. |
Similar incorrect error seen here too https://github.com/cakephp/cakephp/pull/14812/files#file-src-collection-collectiontrait-php-L192 |
@ADmad This doesn’t tell me the error, can you show me what conflicting method is there and how the error looks like? |
@ondrejmirtes If you are using a desktop browser that link should scroll the page to the exact location where error message is shown.
Methods in question: |
Sorry, it seems the links behaves differently for those who don't have commit access to the repo. |
Dear @ondrejmirtes, does this helps you ? https://phpstan.org/r/ffbb5a78-a8b2-46d9-9f45-aa264ed74d94 |
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
Code snippet that reproduces the problem
A new issue cropped up since you updated the stubs that I can't make sense of, other than perhaps PHPStan is incorrectly parsing the $options default from the stubs: https://phpstan.org/r/eb28e725-c7ba-4f56-9dde-fe948c3f2d56
Since there's nowhere that says that this accepts null (not native reflection, and not stubs either, I cross-checked this everywhereI could think of to try and figure out where the
null
was coming from), it's my belief that PHPStan is incorrectly interpreting the default value to be NULL and therefore showing this problem.Expected output
No error.
The text was updated successfully, but these errors were encountered: