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
{{ message }}
This repository was archived by the owner on Nov 28, 2022. It is now read-only.
Currently, phparch (or - more accurately, the DocBlockTypeAnnotations Visitor) uses phpdocumentor in order to parse PHPDoc comments and it's TypeResolver in order to resolve the symbols in these comments to fully qualified names.
The problem is, that the TypeResolver version used by the current stable version of phpdocumentor does not handle arrays of multiple types (e.g. (Foo|Bar)[] or (Foo|null)[]). There is a beta version of the type resolver and phpdocumentor that handle this, but there has been very little action there. Additionally, many other libraries depend on the current version of phpdocumentor - so most environments probably already have a dependency that prevents this library from simply building on top of beta / new versions.
All of this leads me to believe that something else should be used in order to parse docblocks.
In a quick research I found the following libraries that could be helpful. Further research must be done.
Currently, phparch (or - more accurately, the
DocBlockTypeAnnotationsVisitor) uses phpdocumentor in order to parse PHPDoc comments and it's TypeResolver in order to resolve the symbols in these comments to fully qualified names.The problem is, that the TypeResolver version used by the current stable version of phpdocumentor does not handle arrays of multiple types (e.g.
(Foo|Bar)[]or(Foo|null)[]). There is a beta version of the type resolver and phpdocumentor that handle this, but there has been very little action there. Additionally, many other libraries depend on the current version of phpdocumentor - so most environments probably already have a dependency that prevents this library from simply building on top of beta / new versions.All of this leads me to believe that something else should be used in order to parse docblocks.
In a quick research I found the following libraries that could be helpful. Further research must be done.
- Not sure if this can resolve class imports using the
usestatementRequirements for a type resolver:
usestatements.@return ?Foo@return Foo[]@return (Foo|Bar)[]@return array<Foo>@return Collection<Foo>For reference:
https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc.md