1
0
Fork 0

Removed fluent interface resolution

pull/247/head
Ivan Bozhanov 2017-01-21 17:59:19 +02:00
parent 7b4d0d1c60
commit af53973dd5
1 changed files with 8 additions and 33 deletions

View File

@ -479,8 +479,7 @@ class DefinitionResolver
} else {
$classFqn = substr((string)$t->getFqsen(), 1);
}
foreach ($this->getParentsDefinition($classFqn) as $parent) {
$fqn = $parent->fqn . '->' . $expr->name;
$fqn = $classFqn . '->' . $expr->name;
if ($expr instanceof Node\Expr\MethodCall) {
$fqn .= '()';
}
@ -492,7 +491,6 @@ class DefinitionResolver
}
}
}
}
if (
$expr instanceof Node\Expr\StaticCall
|| $expr instanceof Node\Expr\StaticPropertyFetch
@ -655,29 +653,6 @@ class DefinitionResolver
return new Types\Mixed;
}
/**
* Adds the FQNs of all parent classes to an array of FQNs of classes
*
* @param string $fqns
* @return Definition[]
*/
private function getParentsDefinition(string $fqn)
{
$def = $this->index->getDefinition($fqn);
while ($def) {
yield $def;
if ($def->extends) {
foreach ($def->extends as $parent) {
if (($tmp = $this->index->getDefinition($parent)) && $tmp->canBeInstantiated) {
$def = $tmp;
continue;
}
}
}
break;
}
}
/**
* Takes any class name node (from a static method call, or new node) and returns a Type object
* Resolves keywords like self, static and parent