1
0
Fork 0

Fix using @var tag for variables

pull/165/head
Felix Becker 2016-11-21 01:29:38 +01:00
parent 4365fac0b0
commit e6a4103f97
1 changed files with 7 additions and 2 deletions

View File

@ -670,11 +670,16 @@ class DefinitionResolver
|| $node instanceof Node\Expr\Assign
|| $node instanceof Node\Expr\AssignOp
) {
if ($node instanceof Node\Stmt\PropertyProperty || $node instanceof Node\Const_) {
$docBlockHolder = $node->getAttribute('parentNode');
} else {
$docBlockHolder = $node;
}
// Property, constant or variable
// Use @var tag
if (
($parent = $node->getAttribute('parentNode'))
&& ($docBlock = $parent->getAttribute('docBlock'))
isset($docBlockHolder)
&& ($docBlock = $docBlockHolder->getAttribute('docBlock'))
&& !empty($varTags = $docBlock->getTagsByName('var'))
&& ($type = $varTags[0]->getType())
) {