Closed voku closed 1 year ago
I tried to collect data structures of php-files or -strings: https://github.com/voku/Simple-PHP-Code-Parser ... but I have a problem with the "ReflectionDocBlock" package, I do something like:
$parsedParamTags = $phpDoc->getTagsByName('param');
$parsedReturnTag = $phpDoc->getTagsByName('return');
But then I get InvalidTag when I use modern PHPDocs from PHPStan (https://phpstan.org/writing-php-code/phpdoc-types) or psalm (https://psalm.dev/docs/annotating_code/type_syntax/array_types/#object-like-arrays). PS: The syntax is also supported by PhpStorm (https://blog.jetbrains.com/phpstorm/2020/10/phpstorm-2020-3-eap-2/#psalm_and_phpdoc_annotations).
InvalidTag
Do you plan to support the new syntax for e.g. arrays-shapes?
e.g.:
/** * @return array{stdClass: \stdClass, numbers: int|float} $lall */
⇉ "InvalidArgumentException | "\array{stdClass: \stdClass" is not a valid Fqsen.
"InvalidArgumentException | "\array{stdClass: \stdClass" is not a valid Fqsen.
This is definitely needed, since it's getting much more common
will be part of #343
Fixed in https://github.com/phpDocumentor/ReflectionDocBlock/pull/343
I tried to collect data structures of php-files or -strings: https://github.com/voku/Simple-PHP-Code-Parser ... but I have a problem with the "ReflectionDocBlock" package, I do something like:
But then I get
InvalidTag
when I use modern PHPDocs from PHPStan (https://phpstan.org/writing-php-code/phpdoc-types) or psalm (https://psalm.dev/docs/annotating_code/type_syntax/array_types/#object-like-arrays). PS: The syntax is also supported by PhpStorm (https://blog.jetbrains.com/phpstorm/2020/10/phpstorm-2020-3-eap-2/#psalm_and_phpdoc_annotations).Do you plan to support the new syntax for e.g. arrays-shapes?
e.g.:
⇉
"InvalidArgumentException | "\array{stdClass: \stdClass" is not a valid Fqsen.