Page MenuHomePhorge

ArcanistNestedNamespacesXHPASTLinterRule.php
No OneTemporary

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
Wed, Mar 26, 22:22 (1 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1121321
Default Alt Text
ArcanistNestedNamespacesXHPASTLinterRule.php (738 B)

Event Timeline