Changeset View
Changeset View
Standalone View
Standalone View
src/parser/xhpast/api/XHPASTNode.php
Show First 20 Lines • Show All 263 Lines • ▼ Show 20 Lines | public function getNamespace() { | ||||
foreach (array_reverse($namespaces) as $namespace) { | foreach (array_reverse($namespaces) as $namespace) { | ||||
if ($namespace->isAfter($this)) { | if ($namespace->isAfter($this)) { | ||||
continue; | continue; | ||||
} | } | ||||
$body = $namespace->getChildByIndex(1); | $body = $namespace->getChildByIndex(1); | ||||
if ($body->getTypeName() != 'n_EMPTY') { | if ($body->getTypeName() != 'n_EMPTY') { | ||||
if ($body->containsDescendant($this)) { | if (!$body->containsDescendant($this)) { | ||||
return self::getNamespaceName($namespace); | continue; | ||||
} | } | ||||
} | } | ||||
return $namespace->getNamespaceName(); | return $namespace->getNamespaceName(); | ||||
} | } | ||||
return null; | return null; | ||||
} | } | ||||
Show All 20 Lines |