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
My Environment (version of the project, operating system, or hardware):
Any environment will do. I'm using phpda 2.0.2 from composer.
My phpda.yml:
Any config file, e.g. the default.
When I run this command: vendor/bin/phpda
If the project analyzed uses PSR5 array union types, e.g.
* @return (string|array)[]
You get:
Warning "\array)" is not a valid Fqsen. on line [line + file]
PSR5 array union types are already supported by TypeResolver/ReflectionDocBlock. The problem seems to be that, in order to parse the union type, TypeResolver splits the line at ( and )[] (ref).
However, NameResolver strips every occurrence of [], hence TypeResolver will try to split (string|array), which in turn gives the following parts:
[ '(', 'string', '|', 'array)' ]
and the last one isn't recognised as a valid type.
The text was updated successfully, but these errors were encountered:
My Environment (version of the project, operating system, or hardware):
Any environment will do. I'm using phpda 2.0.2 from composer.
My
phpda.yml
:Any config file, e.g. the default.
When I run this command:
vendor/bin/phpda
If the project analyzed uses PSR5 array union types, e.g.
You get:
PSR5 array union types are already supported by TypeResolver/ReflectionDocBlock. The problem seems to be that, in order to parse the union type, TypeResolver splits the line at
(
and)[]
(ref).However, NameResolver strips every occurrence of
[]
, hence TypeResolver will try to split(string|array)
, which in turn gives the following parts:and the last one isn't recognised as a valid type.
The text was updated successfully, but these errors were encountered: