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
More generally, it would be helpful if we could declare one type to be an alias for another, which would be able to solve this by declaring non-empty-string to be an alias for string.
It would solve a broader set of problems as well though, for example: while I'm waiting for #1144, I have some automated stub generation to create imaginary specialised types like FooCollection, BarCollection, etc. This is workable but it breaks whenever intelephense encounters a docblock with a more accurate method return declaration like Collection<Foo>. If I could alias Collection<Foo> to FooCollection then I could effectively tell intelephence to use my stubs for these and the problem would go away.
PHPStan has several advanced types (https://phpstan.org/writing-php-code/phpdoc-types#other-advanced-string-types), for example non-empty-string, numeric-string etc., but intelephense does not convert them to string, so I see an error even that I should not:
Please, can you add support for this?
The text was updated successfully, but these errors were encountered: