ci: Add ability to find documentation for static functions defined in parent contexts
parent
18c6ccd137
commit
df1444502c
|
@ -493,21 +493,33 @@ class DefinitionResolver
|
||||||
} elseif ($scoped->scopeResolutionQualifier instanceof Node\QualifiedName) {
|
} elseif ($scoped->scopeResolutionQualifier instanceof Node\QualifiedName) {
|
||||||
$className = $scoped->scopeResolutionQualifier->getResolvedName();
|
$className = $scoped->scopeResolutionQualifier->getResolvedName();
|
||||||
}
|
}
|
||||||
if ($scoped->memberName instanceof Node\Expression\Variable) {
|
do {
|
||||||
|
if ($scoped->memberName instanceof Node\Expression\Variable) {
|
||||||
|
if ($scoped->parent instanceof Node\Expression\CallExpression) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
$memberName = $scoped->memberName->getName();
|
||||||
|
if (empty($memberName)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
$name = (string)$className . '::$' . $memberName;
|
||||||
|
} else {
|
||||||
|
$name = (string)$className . '::' . $scoped->memberName->getText($scoped->getFileContents());
|
||||||
|
}
|
||||||
if ($scoped->parent instanceof Node\Expression\CallExpression) {
|
if ($scoped->parent instanceof Node\Expression\CallExpression) {
|
||||||
return null;
|
$name .= '()';
|
||||||
}
|
}
|
||||||
$memberName = $scoped->memberName->getName();
|
$definition = $this->index->getDefinition($name);
|
||||||
if (empty($memberName)) {
|
if(!!$definition) {
|
||||||
return null;
|
break;
|
||||||
|
} else {
|
||||||
|
$class = $this->index->getDefinition((string)$className);
|
||||||
|
if(!$class) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$className = $class->extends[0];
|
||||||
}
|
}
|
||||||
$name = (string)$className . '::$' . $memberName;
|
} while (true);
|
||||||
} else {
|
|
||||||
$name = (string)$className . '::' . $scoped->memberName->getText($scoped->getFileContents());
|
|
||||||
}
|
|
||||||
if ($scoped->parent instanceof Node\Expression\CallExpression) {
|
|
||||||
$name .= '()';
|
|
||||||
}
|
|
||||||
return $name;
|
return $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue