Differential D17376 Diff 41802 src/lint/linter/xhpast/rules/ArcanistPHPCompatibilityXHPASTLinterRule.php
Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/xhpast/rules/ArcanistPHPCompatibilityXHPASTLinterRule.php
Show First 20 Lines • Show All 363 Lines • ▼ Show 20 Lines | foreach ($indexes as $index) { | ||||
'codebase targets an earlier version of PHP. You can rewrite '. | 'codebase targets an earlier version of PHP. You can rewrite '. | ||||
'this expression using `%s`.', | 'this expression using `%s`.', | ||||
'f()[...]', | 'f()[...]', | ||||
'idx()')); | 'idx()')); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
$literals = $root->selectDescendantsOftype('n_ARRAY_LITERAL'); | $literals = $root->selectDescendantsOfType('n_ARRAY_LITERAL'); | ||||
foreach ($literals as $literal) { | foreach ($literals as $literal) { | ||||
$open_token = head($literal->getTokens())->getValue(); | $open_token = head($literal->getTokens())->getValue(); | ||||
if ($open_token == '[') { | if ($open_token == '[') { | ||||
$this->raiseLintAtNode( | $this->raiseLintAtNode( | ||||
$literal, | $literal, | ||||
pht( | pht( | ||||
'The short array syntax ("[...]") was not introduced until '. | 'The short array syntax ("[...]") was not introduced until '. | ||||
'PHP 5.4, but this codebase targets an earlier version of PHP. '. | 'PHP 5.4, but this codebase targets an earlier version of PHP. '. | ||||
▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines |