Fix class inheritance issue, fix parenthesized expression type resolution
parent
2ab7fc037a
commit
6d39d87278
|
@ -393,8 +393,8 @@ class TolerantDefinitionResolver implements DefinitionResolverInterface
|
||||||
$name = (string)($node->getNamespacedName());
|
$name = (string)($node->getNamespacedName());
|
||||||
}
|
}
|
||||||
else if (
|
else if (
|
||||||
($scoped = $node) instanceof Tolerant\Node\Expression\ScopedPropertyAccessExpression ||
|
($scoped = $node) instanceof Tolerant\Node\Expression\ScopedPropertyAccessExpression
|
||||||
($scoped = $node->parent) instanceof Tolerant\Node\Expression\ScopedPropertyAccessExpression
|
|| ($scoped = $node->parent) instanceof Tolerant\Node\Expression\ScopedPropertyAccessExpression
|
||||||
|| ($node->parent instanceof Tolerant\Node\Expression\CallExpression && ($scoped = $node->parent->callableExpression) instanceof Tolerant\Node\Expression\ScopedPropertyAccessExpression)
|
|| ($node->parent instanceof Tolerant\Node\Expression\CallExpression && ($scoped = $node->parent->callableExpression) instanceof Tolerant\Node\Expression\ScopedPropertyAccessExpression)
|
||||||
) {
|
) {
|
||||||
// if ($scoped->memberName instanceof Tolerant\Node\Expression) {
|
// if ($scoped->memberName instanceof Tolerant\Node\Expression) {
|
||||||
|
@ -410,7 +410,7 @@ class TolerantDefinitionResolver implements DefinitionResolverInterface
|
||||||
}
|
}
|
||||||
if ($className === 'parent') {
|
if ($className === 'parent') {
|
||||||
// parent is resolved to the parent class
|
// parent is resolved to the parent class
|
||||||
if (!isset($node->extends)) {
|
if (!isset($classNode->extends)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
$className = (string)$classNode->extends->getResolvedName();
|
$className = (string)$classNode->extends->getResolvedName();
|
||||||
|
@ -561,6 +561,11 @@ class TolerantDefinitionResolver implements DefinitionResolverInterface
|
||||||
// How do we handle this more generally?
|
// How do we handle this more generally?
|
||||||
return new Types\Mixed;
|
return new Types\Mixed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($expr instanceof Tolerant\Node\Expression\ParenthesizedExpression) {
|
||||||
|
$expr = $expr->expression;
|
||||||
|
}
|
||||||
|
|
||||||
if ($expr instanceof Tolerant\Node\Expression\Variable || $expr instanceof Tolerant\Node\UseVariableName) {
|
if ($expr instanceof Tolerant\Node\Expression\Variable || $expr instanceof Tolerant\Node\UseVariableName) {
|
||||||
if ($expr instanceof Tolerant\Node\Expression\Variable && $expr->getName() === 'this') {
|
if ($expr instanceof Tolerant\Node\Expression\Variable && $expr->getName() === 'this') {
|
||||||
return new Types\This;
|
return new Types\This;
|
||||||
|
|
Loading…
Reference in New Issue