Page MenuHomeSealhub

ArcanistLogicalOperatorsXHPASTLinterRule.php
No OneTemporary

Authored By
Unknown
Size
813 B
Referenced Files
None
Subscribers
None

ArcanistLogicalOperatorsXHPASTLinterRule.php

<?php
final class ArcanistLogicalOperatorsXHPASTLinterRule
extends ArcanistXHPASTLinterRule {
const ID = 58;
public function getLintName() {
return pht('Logical Operators');
}
public function getLintSeverity() {
return ArcanistLintSeverity::SEVERITY_ADVICE;
}
public function process(XHPASTNode $root) {
$logical_ands = $root->selectTokensOfType('T_LOGICAL_AND');
$logical_ors = $root->selectTokensOfType('T_LOGICAL_OR');
foreach ($logical_ands as $logical_and) {
$this->raiseLintAtToken(
$logical_and,
pht('Use `%s` instead of `%s`.', '&&', 'and'),
'&&');
}
foreach ($logical_ors as $logical_or) {
$this->raiseLintAtToken(
$logical_or,
pht('Use `%s` instead of `%s`.', '||', 'or'),
'||');
}
}
}

File Metadata

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

Event Timeline