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
Both functions takesMaybeFoo and takesMaybeFooBuggy are functionally the same, the former is ok, the latter throws a couple of errors.
takesMaybeFoo
takesMaybeFooBuggy
https://psalm.dev/r/a28247a9bc
The text was updated successfully, but these errors were encountered:
I found these snippets:
<?php class foo { public ?string $prop = null; } function takesMaybeFoo(?foo $foo): void { if (null === $foo || null === $foo->prop) { return; } takesString($foo->prop); } function takesMaybeFooBuggy(?foo $foo): void { if (null === $foo?->prop) { return; } takesString($foo->prop); } function takesString(string $str): string { return $str; }
Psalm output (using commit c82191b): ERROR: PossiblyNullPropertyFetch - 24:17 - Cannot get property on possibly null variable $foo of type foo|null ERROR: PossiblyNullArgument - 24:17 - Argument 1 of takesString cannot be null, possibly null value provided
Sorry, something went wrong.
duplicates #5873
No branches or pull requests
Both functions
takesMaybeFoo
andtakesMaybeFooBuggy
are functionally the same, the former is ok, the latter throws a couple of errors.https://psalm.dev/r/a28247a9bc
The text was updated successfully, but these errors were encountered: