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
When using both PHPStan and Psalm it's kinda annoying since it forces to use double annotation.
It would be great to supports uppercase-string for psalm too, but I feel like it may be more complicated in PHPStan because
PHPStan use an array of accessory (non-empty, non-falsy, lowercase, numeric, uppercase, literal, ...) so can easily represente any intersection of those types.
Psalm use a class for every existing intersection. So psalm has TNonEmptyString, TNonFalsyString, TNumericString, TLowercaseString, TNonEmptyLowercaseString, but is already missing classes like TNonFalsyLowercaseString, TNonFalsyNumericString (to exclude 0), TNumericLowercaseString (if you need to exclude 10E2) and introducing TUppercaseString would require multiple new classes (knowning that even TLowercaseUppercaseString is technically possible for string without letter like numbers or special characters).
So at least would it be easily possible for Psalm to consider uppercase-string as an alias for string, in order to avoid using double annotation when using both PHPStan and psalm ?
The text was updated successfully, but these errors were encountered:
Psalm output (using commit c7c5a69):
ERROR: InvalidDocblock - 4:11 - Unrecognized type uppercase-string in docblock for foo
ERROR: InvalidDocblock - 8:1 - Unrecognized type uppercase-string in docblock for foo
INFO: MissingReturnType - 8:10 - Method foo does not have a return type, expecting string
In the same way psalm supports
lowercase-string
PHPStan does.But PHPStan also supports
uppercase-string
. (phpstan/phpstan-src#3613)https://phpstan.org/r/1bb5f514-6781-48a8-a775-70c8fbe8bb3a
Psalm currently does not understand the type https://psalm.dev/r/f5835a8213
When using both PHPStan and Psalm it's kinda annoying since it forces to use double annotation.
It would be great to supports uppercase-string for psalm too, but I feel like it may be more complicated in PHPStan because
0
), TNumericLowercaseString (if you need to exclude10E2
) and introducing TUppercaseString would require multiple new classes (knowning that evenTLowercaseUppercaseString
is technically possible for string without letter like numbers or special characters).So at least would it be easily possible for Psalm to consider
uppercase-string
as an alias forstring
, in order to avoid using double annotation when using both PHPStan and psalm ?The text was updated successfully, but these errors were encountered: