1
0
mirror of https://github.com/nikic/PHP-Parser.git synced 2025-07-05 22:43:32 +02:00

NameResolver - resolve Name in NullableType

This commit is contained in:
Ondrej Mirtes
2016-12-05 22:21:34 +01:00
committed by Nikita Popov
parent 030de805e1
commit a485ecd7ba
2 changed files with 19 additions and 7 deletions
lib/PhpParser/NodeVisitor
test/PhpParser/NodeVisitor

@ -112,7 +112,10 @@ class NameResolver extends NodeVisitorAbstract
}
}
}
} elseif ($node instanceof Node\NullableType) {
if ($node->type instanceof Name) {
$node->type = $this->resolveClassName($node->type);
}
}
}

@ -199,9 +199,12 @@ interface A extends C, D {
public function a(A $a) : A;
}
function fn() : A {}
function fn2() : array {}
function() : A {};
function fn(A $a) : A {}
function fn2(array $a) : array {}
function(A $a) : A {};
function fn3(?A $a) : ?A {}
function fn4(?array $a) : ?array {}
A::b();
A::$b;
@ -233,14 +236,20 @@ interface A extends \NS\C, \NS\D
{
public function a(\NS\A $a) : \NS\A;
}
function fn() : \NS\A
function fn(\NS\A $a) : \NS\A
{
}
function fn2() : array
function fn2(array $a) : array
{
}
function () : \NS\A {
function (\NS\A $a) : \NS\A {
};
function fn3(?NS\A $a) : ?NS\A
{
}
function fn4(?array $a) : ?array
{
}
\NS\A::b();
\NS\A::$b;
\NS\A::B;