mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-01-24 21:48:20 +01:00
32 lines
650 B
PHP
32 lines
650 B
PHP
|
<?php
|
||
|
|
||
|
final class ArcanistInlineHTMLXHPASTLinterRule
|
||
|
extends ArcanistXHPASTLinterRule {
|
||
|
|
||
|
const ID = 78;
|
||
|
|
||
|
public function getLintName() {
|
||
|
return pht('Inline HTML');
|
||
|
}
|
||
|
|
||
|
public function getLintSeverity() {
|
||
|
return ArcanistLintSeverity::SEVERITY_DISABLED;
|
||
|
}
|
||
|
|
||
|
public function process(XHPASTNode $root) {
|
||
|
$inline_html = $root->selectTokensOfType('T_INLINE_HTML');
|
||
|
|
||
|
foreach ($inline_html as $html) {
|
||
|
if (substr($html->getValue(), 0, 2) == '#!') {
|
||
|
// Ignore shebang lines.
|
||
|
continue;
|
||
|
}
|
||
|
|
||
|
$this->raiseLintAtToken(
|
||
|
$html,
|
||
|
pht('PHP files must only contain PHP code.'));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|