Page MenuHomePhorge

ArcanistGlobalVariableXHPASTLinterRule.php
No OneTemporary

ArcanistGlobalVariableXHPASTLinterRule.php

<?php
final class ArcanistGlobalVariableXHPASTLinterRule
extends ArcanistXHPASTLinterRule {
const ID = 79;
public function getLintName() {
return pht('Global Variables');
}
public function getLintSeverity() {
return ArcanistLintSeverity::SEVERITY_WARNING;
}
public function process(XHPASTNode $root) {
$nodes = $root->selectDescendantsOfType('n_GLOBAL_DECLARATION_LIST');
foreach ($nodes as $node) {
$this->raiseLintAtNode(
$node,
pht(
'Limit the use of global variables. Global variables are '.
'generally a bad idea and should be avoided when possible.'));
}
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, Jan 19, 12:53 (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1120448
Default Alt Text
ArcanistGlobalVariableXHPASTLinterRule.php (650 B)

Event Timeline