-
Notifications
You must be signed in to change notification settings - Fork 651
New issue
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
non empty string constants should be considered as a non empty string #6266
Labels
Comments
I found these snippets: https://psalm.dev/r/377464f1cd<?php
function foo(): void {
/** @psalm-trace $a */
$a = PHP_EOL;
return;
}
|
This one should be inferred as literal |
The other two, I believe, would safe to assume non-empty. |
Can be inherited and change value in the child |
If I use static::FOO, or if it's final, it should be ok no ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With the option
In
$bar is considered as always an array.
In
$bar is considered as array|false.
So I would say that explode is correctly supporting non-empty-string, but some constant are not considered as non-empty-string. I tried
public const FOO = 'foo';
Should these be
non-empty-string
?https://psalm.dev/r/377464f1cd
The text was updated successfully, but these errors were encountered: