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
IMHO we shouldn't add annotations for phan + phpstan + psalm. It adds to much overhead to support all of those and next week we might have another 3 additionally.
Pick one and stick to it.
This was for https://github.com/phan/phan , not psalm or phpstan, because I'm using phan in a project using php-enum. So phan would get the generic types without any information about key types, and not be provided the information to warn about somesubclass::getValues()['not_an_integer']
@phan-return list<null|bool|int|float|string|array> for getValues()
@phan-return list<non-empty-string> for getNames() instead of string[]
@phan-return array<string, null|bool|int|float|string|array> for getConstants()
Although I may eventually add an option for phan to read psalm-specific annotations, and ignore syntax that it doesn't understand, that approach would cause bugs in custom types declared with @psalm-type
https://github.com/phan/phan/wiki/Annotating-Your-Source-Code documents the available options. https://github.com/phan/phan/wiki/About-Union-Types documents union types supported by Phan.
non-empty-string
is not supported in array keys.The text was updated successfully, but these errors were encountered: