Page MenuHomeSealhub

ArcanistCommentSpacingXHPASTLinterRule.php
No OneTemporary

Authored By
Unknown
Size
754 B
Referenced Files
None
Subscribers
None

ArcanistCommentSpacingXHPASTLinterRule.php

<?php
final class ArcanistCommentSpacingXHPASTLinterRule
extends ArcanistXHPASTLinterRule {
const ID = 34;
public function getLintName() {
return pht('Comment Spaces');
}
public function getLintSeverity() {
return ArcanistLintSeverity::SEVERITY_ADVICE;
}
public function process(XHPASTNode $root) {
foreach ($root->selectTokensOfType('T_COMMENT') as $comment) {
$value = $comment->getValue();
if ($value[0] !== '#') {
$match = null;
if (preg_match('@^(/[/*]+)[^/*\s]@', $value, $match)) {
$this->raiseLintAtOffset(
$comment->getOffset(),
pht('Put space after comment start.'),
$match[1],
$match[1].' ');
}
}
}
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Nov 27, 15:38 (1 d, 4 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1209148
Default Alt Text
ArcanistCommentSpacingXHPASTLinterRule.php (754 B)

Event Timeline