Merge c3b8cbd73b
into 9dc1656592
commit
6832785338
|
@ -41,3 +41,6 @@ TestClass::$staticTestProperty[123]->testProperty;
|
||||||
|
|
||||||
$child = new ChildClass;
|
$child = new ChildClass;
|
||||||
echo $child->testMethod();
|
echo $child->testMethod();
|
||||||
|
|
||||||
|
ChildClass::staticTestMethod();
|
||||||
|
ChildClass::$staticTestProperty[123]->testProperty;
|
||||||
|
|
|
@ -41,3 +41,6 @@ TestClass::$staticTestProperty[123]->testProperty;
|
||||||
|
|
||||||
$child = new ChildClass;
|
$child = new ChildClass;
|
||||||
echo $child->testMethod();
|
echo $child->testMethod();
|
||||||
|
|
||||||
|
ChildClass::staticTestMethod();
|
||||||
|
ChildClass::$staticTestProperty[123]->testProperty;
|
||||||
|
|
|
@ -499,6 +499,8 @@ class DefinitionResolver
|
||||||
} elseif ($scoped->scopeResolutionQualifier instanceof Node\QualifiedName) {
|
} elseif ($scoped->scopeResolutionQualifier instanceof Node\QualifiedName) {
|
||||||
$className = $scoped->scopeResolutionQualifier->getResolvedName();
|
$className = $scoped->scopeResolutionQualifier->getResolvedName();
|
||||||
}
|
}
|
||||||
|
$origName = null;
|
||||||
|
$nameSuffix = null;
|
||||||
if ($scoped->memberName instanceof Node\Expression\Variable) {
|
if ($scoped->memberName instanceof Node\Expression\Variable) {
|
||||||
if ($scoped->parent instanceof Node\Expression\CallExpression) {
|
if ($scoped->parent instanceof Node\Expression\CallExpression) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -507,13 +509,29 @@ class DefinitionResolver
|
||||||
if (empty($memberName)) {
|
if (empty($memberName)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
$name = (string)$className . '::$' . $memberName;
|
$nameSuffix = '::$' . $memberName;
|
||||||
} else {
|
} else {
|
||||||
$name = (string)$className . '::' . $scoped->memberName->getText($scoped->getFileContents());
|
$nameSuffix = '::' . $scoped->memberName->getText($scoped->getFileContents());
|
||||||
}
|
}
|
||||||
if ($scoped->parent instanceof Node\Expression\CallExpression) {
|
if ($scoped->parent instanceof Node\Expression\CallExpression) {
|
||||||
$name .= '()';
|
$nameSuffix .= '()';
|
||||||
}
|
}
|
||||||
|
do {
|
||||||
|
$name = (string)$className . $nameSuffix;
|
||||||
|
if ($origName === null) {
|
||||||
|
$origName = $name;
|
||||||
|
}
|
||||||
|
$definition = $this->index->getDefinition($name);
|
||||||
|
if (!!$definition) {
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
$class = $this->index->getDefinition((string)$className);
|
||||||
|
if ($class === null || empty($class->extends)) {
|
||||||
|
return $origName;
|
||||||
|
}
|
||||||
|
$className = $class->extends[0];
|
||||||
|
}
|
||||||
|
} while (true);
|
||||||
return $name;
|
return $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,10 +155,12 @@ abstract class ServerTestCase extends TestCase
|
||||||
],
|
],
|
||||||
'TestNamespace\\TestClass::staticTestProperty' => [
|
'TestNamespace\\TestClass::staticTestProperty' => [
|
||||||
0 => new Location($referencesUri, new Range(new Position( 8, 16), new Position( 8, 35))), // echo TestClass::$staticTestProperty;
|
0 => new Location($referencesUri, new Range(new Position( 8, 16), new Position( 8, 35))), // echo TestClass::$staticTestProperty;
|
||||||
1 => new Location($referencesUri, new Range(new Position(39, 11), new Position(39, 30))) // TestClass::$staticTestProperty[123]->testProperty;
|
1 => new Location($referencesUri, new Range(new Position(39, 11), new Position(39, 30))), // TestClass::$staticTestProperty[123]->testProperty;
|
||||||
|
2 => new Location($referencesUri, new Range(new Position(45, 12), new Position(45, 31))) // ChildClass::$staticTestProperty[123]->testProperty;
|
||||||
],
|
],
|
||||||
'TestNamespace\\TestClass::staticTestMethod()' => [
|
'TestNamespace\\TestClass::staticTestMethod()' => [
|
||||||
0 => new Location($referencesUri, new Range(new Position( 7, 0), new Position( 7, 27)))
|
0 => new Location($referencesUri, new Range(new Position( 7, 0), new Position( 7, 27))),
|
||||||
|
1 => new Location($referencesUri, new Range(new Position(44, 0), new Position(44, 28)))
|
||||||
],
|
],
|
||||||
'TestNamespace\\TestClass::testMethod()' => [
|
'TestNamespace\\TestClass::testMethod()' => [
|
||||||
0 => new Location($referencesUri, new Range(new Position( 5, 0), new Position( 5, 16))), // $obj->testMethod();
|
0 => new Location($referencesUri, new Range(new Position( 5, 0), new Position( 5, 16))), // $obj->testMethod();
|
||||||
|
@ -209,10 +211,12 @@ abstract class ServerTestCase extends TestCase
|
||||||
],
|
],
|
||||||
'TestClass::staticTestProperty' => [
|
'TestClass::staticTestProperty' => [
|
||||||
0 => new Location($globalReferencesUri, new Range(new Position( 8, 16), new Position( 8, 35))), // echo TestClass::$staticTestProperty;
|
0 => new Location($globalReferencesUri, new Range(new Position( 8, 16), new Position( 8, 35))), // echo TestClass::$staticTestProperty;
|
||||||
1 => new Location($globalReferencesUri, new Range(new Position(39, 11), new Position(39, 30))) // TestClass::$staticTestProperty[123]->testProperty;
|
1 => new Location($globalReferencesUri, new Range(new Position(39, 11), new Position(39, 30))), // TestClass::$staticTestProperty[123]->testProperty;
|
||||||
|
2 => new Location($globalReferencesUri, new Range(new Position(45, 12), new Position(45, 31))) // ChildClass::$staticTestProperty[123]->testProperty;
|
||||||
],
|
],
|
||||||
'TestClass::staticTestMethod()' => [
|
'TestClass::staticTestMethod()' => [
|
||||||
0 => new Location($globalReferencesUri, new Range(new Position( 7, 0), new Position( 7, 27)))
|
0 => new Location($globalReferencesUri, new Range(new Position( 7, 0), new Position( 7, 27))),
|
||||||
|
1 => new Location($globalReferencesUri, new Range(new Position(44, 0), new Position(44, 28)))
|
||||||
],
|
],
|
||||||
'TestClass::testMethod()' => [
|
'TestClass::testMethod()' => [
|
||||||
0 => new Location($globalReferencesUri, new Range(new Position( 5, 0), new Position( 5, 16))), // $obj->testMethod();
|
0 => new Location($globalReferencesUri, new Range(new Position( 5, 0), new Position( 5, 16))), // $obj->testMethod();
|
||||||
|
|
Loading…
Reference in New Issue