Page MenuHomeSealhub

ArcanistNestedNamespacesXHPASTLinterRule.php
No OneTemporary

Authored By
Unknown
Size
738 B
Referenced Files
None
Subscribers
None

ArcanistNestedNamespacesXHPASTLinterRule.php

<?php
final class ArcanistNestedNamespacesXHPASTLinterRule
extends ArcanistXHPASTLinterRule {
const ID = 90;
public function getLintName() {
return pht('Nested `%s` Statements', 'namespace');
}
public function process(XHPASTNode $root) {
$namespaces = $root->selectDescendantsOfType('n_NAMESPACE');
foreach ($namespaces as $namespace) {
$nested_namespaces = $namespace->selectDescendantsOfType('n_NAMESPACE');
foreach ($nested_namespaces as $nested_namespace) {
$this->raiseLintAtNode(
$nested_namespace,
pht(
'`%s` declarations cannot be nested. '.
'This construct will cause a PHP fatal error.',
'namespace'));
}
}
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Nov 27, 17:27 (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1221810
Default Alt Text
ArcanistNestedNamespacesXHPASTLinterRule.php (738 B)

Event Timeline