mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-26 20:14:46 +01:00
Merge branch '3.x'
This commit is contained in:
commit
dce34f37db
@ -183,13 +183,20 @@ class NameResolver extends NodeVisitorAbstract
|
|||||||
/** @param Stmt\Function_|Stmt\ClassMethod|Expr\Closure $node */
|
/** @param Stmt\Function_|Stmt\ClassMethod|Expr\Closure $node */
|
||||||
private function resolveSignature($node) {
|
private function resolveSignature($node) {
|
||||||
foreach ($node->params as $param) {
|
foreach ($node->params as $param) {
|
||||||
if ($param->type instanceof Name) {
|
$param->type = $this->resolveType($param->type);
|
||||||
$param->type = $this->resolveClassName($param->type);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ($node->returnType instanceof Name) {
|
$node->returnType = $this->resolveType($node->returnType);
|
||||||
$node->returnType = $this->resolveClassName($node->returnType);
|
}
|
||||||
|
|
||||||
|
private function resolveType($node) {
|
||||||
|
if ($node instanceof Node\NullableType) {
|
||||||
|
$node->type = $this->resolveType($node->type);
|
||||||
|
return $node;
|
||||||
}
|
}
|
||||||
|
if ($node instanceof Name) {
|
||||||
|
return $this->resolveClassName($node);
|
||||||
|
}
|
||||||
|
return $node;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user