Page MenuHomeSealhub

ArcanistCommentStyleXHPASTLinterRule.php
No OneTemporary

Authored By
Unknown
Size
635 B
Referenced Files
None
Subscribers
None

ArcanistCommentStyleXHPASTLinterRule.php

<?php
final class ArcanistCommentStyleXHPASTLinterRule
extends ArcanistXHPASTLinterRule {
const ID = 18;
public function getLintName() {
return pht('Comment Style');
}
public function process(XHPASTNode $root) {
foreach ($root->selectTokensOfType('T_COMMENT') as $comment) {
$value = $comment->getValue();
if ($value[0] !== '#') {
continue;
}
$this->raiseLintAtOffset(
$comment->getOffset(),
pht(
'Use `%s` single-line comments, not `%s`.',
'//',
'#'),
'#',
preg_match('/^#\S/', $value) ? '// ' : '//');
}
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Nov 28, 03:10 (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1208730
Default Alt Text
ArcanistCommentStyleXHPASTLinterRule.php (635 B)

Event Timeline