Page MenuHomePhorge

ArcanistPaamayimNekudotayimSpacingXHPASTLinterRule.php
No OneTemporary

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
Jan 19 2025, 11:43 (5 w, 13 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1124209
Default Alt Text
ArcanistPaamayimNekudotayimSpacingXHPASTLinterRule.php (1003 B)

Event Timeline