Differential D25030 Diff 82 src/lint/linter/xhpast/rules/ArcanistDeclarationParenthesesXHPASTLinterRule.php
Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/xhpast/rules/ArcanistDeclarationParenthesesXHPASTLinterRule.php
Context not available. | |||||
// Anonymous functions. | // Anonymous functions. | ||||
if ($leading_text != ' ') { | if ($leading_text != ' ') { | ||||
$this->raiseLintAtOffset( | $this->raiseLintAtOffset( | ||||
$first->getOffset() - strlen($leading_text), | $first->getOffset() - @strlen($leading_text), | ||||
pht( | pht( | ||||
'Convention: space before opening parenthesis in '. | 'Convention: space before opening parenthesis in '. | ||||
'anonymous function declarations.'), | 'anonymous function declarations.'), | ||||
Context not available. | |||||
' '); | ' '); | ||||
} | } | ||||
} else { | } else { | ||||
if (preg_match('/^\s+$/', $leading_text)) { | if (@preg_match('/^\s+$/', $leading_text)) { | ||||
$this->raiseLintAtOffset( | $this->raiseLintAtOffset( | ||||
$first->getOffset() - strlen($leading_text), | $first->getOffset() - @strlen($leading_text), | ||||
pht( | pht( | ||||
'Convention: no spaces before opening parenthesis in '. | 'Convention: no spaces before opening parenthesis in '. | ||||
'function and method declarations.'), | 'function and method declarations.'), | ||||
Context not available. | |||||
} | } | ||||
} | } | ||||
if (preg_match('/^\s+$/', $trailing_text)) { | if (@preg_match('/^\s+$/', $trailing_text)) { | ||||
$this->raiseLintAtOffset( | $this->raiseLintAtOffset( | ||||
$last->getOffset() - strlen($trailing_text), | $last->getOffset() - @strlen($trailing_text), | ||||
pht( | pht( | ||||
'Convention: no spaces before closing parenthesis in '. | 'Convention: no spaces before closing parenthesis in '. | ||||
'function and method declarations.'), | 'function and method declarations.'), | ||||
Context not available. | |||||
if (!$after) { | if (!$after) { | ||||
$this->raiseLintAtOffset( | $this->raiseLintAtOffset( | ||||
$use->getOffset() + strlen($use->getValue()), | $use->getOffset() + @strlen($use->getValue()), | ||||
pht( | pht( | ||||
'Convention: space after `%s` token.', | 'Convention: space after `%s` token.', | ||||
'use'), | 'use'), | ||||
Context not available. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0