Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add ObjectShapeNode to support @var object{foo: string} $foo #145

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

Closed
samsonasik wants to merge 1 commit into phpstan:1.7.x from samsonasik:add-object-shape

Conversation

Copy link

@samsonasik samsonasik commented Aug 23, 2022

The issue originally on :

which has failing test at:

which the VarTagValueNode got empty variable name and the variable goes to description:

PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode #17240
 type: PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode #17247
 | name: 'object'
 | attributes: array (2)
 | | 'parent' => PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode #17470 see below
 | | 'orig_node' => PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode #17249
 | | | name: 'object'
 | | | attributes: array (1)
 | | | | 'parent' => PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode #17470 see below
 variableName: ''
 description: '{foo: string} $foo'

This PR try to add support for @var object{foo: string} $foo usage. In PHPStan demo site itself, it detected as property $foo not exists:

https://phpstan.org/r/47583831-d7ae-43b8-bae9-bfabead3459b

while it actually exists https://3v4l.org/Vo8FA

Copy link
Author

I just realized there is already PR #141 for it, so closing it then.

@samsonasik samsonasik deleted the add-object-shape branch August 23, 2022 11:06
Copy link
Contributor

@samsonasik feel free to pick up where i left off on #141, i'm not going to have a lot of time to work on OSS for a while unfortunately.

Copy link
Contributor

@mad-briller Thanks for the test fixture 👍

I've added a workaround for time being, untill it get's added to php-doc parser :)
rectorphp/rector-src#2837

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /