Created
February 13, 2014 11:15
-
-
Save rvanvelzen/8973388 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ClassFinderVisitor.php b/ClassFinderVisitor.php | |
index 82a4792..29e85e2 100644 | |
--- a/ClassFinderVisitor.php | |
+++ b/ClassFinderVisitor.php | |
@@ -55,22 +55,22 @@ class ClassFinderVisitor extends \PHPParser_NodeVisitorAbstract | |
|| $node instanceof \PHPParser_Node_Stmt_Interface | |
|| $node instanceof \PHPParser_Node_Stmt_Trait | |
) { | |
- $className = (string)$node->name; | |
+ $className = (string)$node->namespacedName; | |
$this->classes[$className] = array(); | |
$this->currentContext = $className; | |
} | |
+ } | |
+ public function leaveNode(\PHPParser_Node $node) | |
+ { | |
if ($node instanceof \PHPParser_Node_Stmt_ClassMethod) { | |
$methodName = strtolower((string)$node->name); | |
if ($methodName === '__construct' || $methodName === strtolower($this->currentContext)) { | |
$this->retrieveConstructorDependencies($node); | |
} | |
} | |
- } | |
- | |
- public function leaveNode(\PHPParser_Node $node) | |
- { | |
+ | |
if ($node instanceof \PHPParser_Node_Stmt_Class | |
|| $node instanceof \PHPParser_Node_Stmt_Interface | |
|| $node instanceof \PHPParser_Node_Stmt_Trait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment