★ wanayoo — archive 1999 https://github.com/phpDocumentor/ReflectionDocBlock/issues/263Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for array-shapes? #263

Open
voku opened this issue Oct 29, 2020 · 0 comments
Open

support for array-shapes? #263

voku opened this issue Oct 29, 2020 · 0 comments

Comments

@voku
Copy link
Contributor

@voku voku commented Oct 29, 2020 •

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.

voku added a commit to voku/Simple-PHP-Code-Parser that referenced this issue Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.