Skip to content

Conversation

@samsonasik
Copy link

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

@samsonasik
Copy link
Author

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

@samsonasik samsonasik closed this Aug 23, 2022
@samsonasik samsonasik deleted the add-object-shape branch August 23, 2022 11:06
@mad-briller
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.

@TomasVotruba
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants