You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ($call_args[0]->value instanceof PhpParser\Node\Scalar\String_) {
this condition is suboptimal because it checks that the parameter is a literal string, not a variable nor a a constant
Yes with SPLIT_SEPARATOR psalm thinks, the separator could be empty. which would result in returning false before php 8.0.
So I think there are two bugs. psalm should detect that the constant is not empty. and psalm should know, that explode can not return false anymore since php 8.0.
The text was updated successfully, but these errors were encountered:
Psalm output (using commit 5baf85e):
INFO: LessSpecificReturnStatement - 33:16 - The type 'array{familyName: null|string, givenName: null|string}' is more general than the declared return type 'array{familyName: string, givenName: string}' for App\Domain\Addressing\Name::split
INFO: MoreSpecificReturnType - 23:16 - The declared return type 'array{familyName: string, givenName: string}' for App\Domain\Addressing\Name::split is more specific than the inferred return type 'array{familyName: null|string, givenName: null|string}'
Errors with const: https://psalm.dev/r/d5a6c69fdc
No errors without const: https://psalm.dev/r/76b2904ea2
Some relevant comments from Slack:
Error comes from here:
psalm/src/Psalm/Internal/Provider/ReturnTypeProvider/ExplodeReturnTypeProvider.php
Line 56 in b924032
The text was updated successfully, but these errors were encountered: