Skip to content

Commit

Permalink
correct issue where there exist multiple namespaces in one file. refs s…
Browse files Browse the repository at this point in the history
  • Loading branch information
craigh committed Jun 16, 2015
1 parent 816bd54 commit 7a4cde2
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,18 @@ public function enterNode(\PHPParser_Node $node)
* Finder appears to start with root level files so Namespace is correct for remaining files
*/
if ($node instanceof \PHPParser_Node_Stmt_Namespace) {
if (array_key_exists($node->name->toString(), $this->bundles)) {
$this->domain = strtolower($this->bundles[$node->name->toString()]);
if (isset($node->name)) {
if (array_key_exists($node->name->toString(), $this->bundles)) {
$this->domain = strtolower($this->bundles[$node->name->toString()]);
}

return;
} else {
foreach ($node->stmts as $node) {
$this->enterNode($node);
}

return;
}
}
if (!$node instanceof \PHPParser_Node_Expr_MethodCall
Expand Down

1 comment on commit 7a4cde2

@cmfcmf
Copy link
Contributor

@cmfcmf cmfcmf commented on 7a4cde2 Jun 16, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.