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
Example: https://psalm.dev/r/fe5ff75f6a
Hi, the statement would be correct for class A and if it was final, but it should take into account that a class could be extended, or?
The text was updated successfully, but these errors were encountered:
I found these snippets:
<?php class A { } class B { public int $a = 1; } function writeDictionary(A $dictionary): void { $values = get_object_vars($dictionary); ksort($values, SORT_STRING); }
Psalm output (using commit 0ded59d): ERROR: RedundantFunctionCall - 12:2 - The call to ksort is unnecessary, array<never, never> is already a list
Sorry, something went wrong.
indeed, Psalm should not assume a child of the appearing object won't have new properties, unless the class is final.
This is handled here:
psalm/src/Psalm/Internal/Provider/ReturnTypeProvider/GetObjectVarsReturnTypeProvider.php
Line 65 in 97e6511
Successfully merging a pull request may close this issue.
Example: https://psalm.dev/r/fe5ff75f6a
Hi, the statement would be correct for class A and if it was final, but it should take into account that a class could be extended, or?
The text was updated successfully, but these errors were encountered: