1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-30 04:19:30 +01:00

Remove redundant check in NameResolver

This commit is contained in:
nikic 2011-09-29 18:51:12 +02:00
parent 53d33345e1
commit b7a034cd9f
2 changed files with 5 additions and 7 deletions

View File

@ -55,7 +55,7 @@ interface (and extend `PHPParser_NodeAbstract`). Furthermore nodes are divided i
`PHPParser_Node_Scalar` inherits from `PHPParser_Node_Expr`.
Each node may have subnodes. For example `PHPParser_Node_Expr_Plus` has two subnodes, namely `left`
and `right`, which represend the left hand side and right hand side expressions of the plus operation.
and `right`, which represent the left hand side and right hand side expressions of the plus operation.
Subnodes are accessed as normal properties:
$node->left

View File

@ -52,13 +52,11 @@ class PHPParser_NodeVisitor_NameResolver extends PHPParser_NodeVisitorAbstract
|| $node instanceof PHPParser_Node_Expr_Instanceof
) {
$node->class = $this->resolveClassName($node->class);
} elseif ($node instanceof PHPParser_Node_Expr_FuncCall) {
$node->name = $this->resolveOtherName($node->name);
} elseif ($node instanceof PHPParser_Node_Expr_ConstFetch) {
$node->name = $this->resolveOtherName($node->name);
} elseif ($node instanceof PHPParser_Node_Param
&& $node->type instanceof PHPParser_Node_Name
} elseif ($node instanceof PHPParser_Node_Expr_FuncCall
|| $node instanceof PHPParser_Node_Expr_ConstFetch
) {
$node->name = $this->resolveOtherName($node->name);
} elseif ($node instanceof PHPParser_Node_Param) {
$node->type = $this->resolveClassName($node->type);
}
}