Skip to content

support for array-shapes? #263

Closed
Closed
@voku

Description

@voku

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).

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions