From b7a034cd9fc0ebc7124bf850996056b6169c8c75 Mon Sep 17 00:00:00 2001 From: nikic Date: Thu, 29 Sep 2011 18:51:12 +0200 Subject: [PATCH] Remove redundant check in NameResolver --- README.md | 2 +- lib/PHPParser/NodeVisitor/NameResolver.php | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index dbf4fa3..8664c23 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/lib/PHPParser/NodeVisitor/NameResolver.php b/lib/PHPParser/NodeVisitor/NameResolver.php index cea411f..ee2535b 100644 --- a/lib/PHPParser/NodeVisitor/NameResolver.php +++ b/lib/PHPParser/NodeVisitor/NameResolver.php @@ -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); } }