Page MenuHomePhorge

ArcanistEmptyFileXHPASTLinterRule.php
No OneTemporary

ArcanistEmptyFileXHPASTLinterRule.php

<?php
final class ArcanistEmptyFileXHPASTLinterRule
extends ArcanistXHPASTLinterRule {
const ID = 82;
public function getLintName() {
return pht('Empty File');
}
public function getLintSeverity() {
return ArcanistLintSeverity::SEVERITY_WARNING;
}
public function process(XHPASTNode $root) {
$tokens = $root->getTokens();
foreach ($tokens as $token) {
switch ($token->getTypeName()) {
case 'T_OPEN_TAG':
case 'T_CLOSE_TAG':
case 'T_WHITESPACE':
break;
default:
return;
}
}
$this->raiseLintAtPath(
pht("Empty files usually don't serve any useful purpose."));
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, Mar 23, 23:58 (1 d, 5 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1121247
Default Alt Text
ArcanistEmptyFileXHPASTLinterRule.php (680 B)

Event Timeline