We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://phpstan.org/r/1452c341-14e6-41bd-97ad-c48781322eb3
The types should be the same (both should be int|null).
int|null
It helps me every time I make a commit by trapping bugs that would take me hours to find by hand. 👍
The text was updated successfully, but these errors were encountered:
Hi, thank you for your kind words!
This should be fixable easily by modifying the stub here: https://github.com/phpstan/phpstan-src/blob/da3790efa9f5ee96c3b7905342904fe3651a29af/stubs/ArrayObject.stub#L89-L108
offsetGet needs to be overriden like this:
offsetGet
/** * @param TKey $offset * @return TValue */ public function offsetGet($offset);
Please test the change in NodeScopeResolverTest, thanks.
Sorry, something went wrong.
@dktapps After the latest commit in dev-master, PHPStan now reports different result with your code snippet:
@@ @@ 13: Dumped type: int|null -14: Dumped type: int +14: Dumped type: int|null
Fixed by phpstan/phpstan-src#587.
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.
No branches or pull requests
Bug report
Code snippet that reproduces the problem
https://phpstan.org/r/1452c341-14e6-41bd-97ad-c48781322eb3
Expected output
The types should be the same (both should be
int|null
).Did PHPStan help you today? Did it make you happy in any way?
It helps me every time I make a commit by trapping bugs that would take me hours to find by hand. 👍
The text was updated successfully, but these errors were encountered: