Page MenuHomeSealhub

ArcanistPaamayimNekudotayimSpacingXHPASTLinterRule.php
No OneTemporary

Authored By
Unknown
Size
1003 B
Referenced Files
None
Subscribers
None

ArcanistPaamayimNekudotayimSpacingXHPASTLinterRule.php

<?php
final class ArcanistPaamayimNekudotayimSpacingXHPASTLinterRule
extends ArcanistXHPASTLinterRule {
const ID = 96;
public function getLintName() {
return pht('Paamayim Nekudotayim Spacing');
}
public function getLintSeverity() {
return ArcanistLintSeverity::SEVERITY_WARNING;
}
public function process(XHPASTNode $root) {
$double_colons = $root->selectTokensOfType('T_PAAMAYIM_NEKUDOTAYIM');
foreach ($double_colons as $double_colon) {
$tokens = $double_colon->getNonsemanticTokensBefore() +
$double_colon->getNonsemanticTokensAfter();
foreach ($tokens as $token) {
if ($token->isAnyWhitespace()) {
if (strpos($token->getValue(), "\n") !== false) {
continue;
}
$this->raiseLintAtToken(
$token,
pht(
'Unnecessary whitespace around paamayim nekudotayim '.
'(double colon) operator.'),
'');
}
}
}
}
}

File Metadata

Mime Type
text/x-php
Expires
Fri, Nov 27, 15:49 (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1206135
Default Alt Text
ArcanistPaamayimNekudotayimSpacingXHPASTLinterRule.php (1003 B)

Event Timeline