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://psalm.dev/r/2b0238bf51
When using a class-string to construct while missing a parameter, Psalm fails to report the TooFewArguments issue.
Here is some very similar code that shows the expected TooFewArguments issue https://psalm.dev/r/4b2ded22f6
The text was updated successfully, but these errors were encountered:
I found these snippets:
<?php /** * @psalm-consistent-constructor */ class A { final public function __construct(public int $val) { } } /** * @return class-string<A> */ function getClass(): string { return A::class; } $aStr = getClass(); // A::class; $obj = new $aStr(); echo $obj->val;
Psalm output (using commit c7c5a69): No issues!
<?php /** * @psalm-consistent-constructor */ class A { final public function __construct(public int $val) { } } $aStr = A::class; $obj = new $aStr(); echo $obj->val;
Psalm output (using commit c7c5a69): ERROR: TooFewArguments - 13:8 - Too few arguments for A::__construct - expecting val to be passed
Sorry, something went wrong.
No branches or pull requests
https://psalm.dev/r/2b0238bf51
When using a class-string to construct while missing a parameter, Psalm fails to report the TooFewArguments issue.
Here is some very similar code that shows the expected TooFewArguments issue https://psalm.dev/r/4b2ded22f6
The text was updated successfully, but these errors were encountered: