mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-02-17 01:08:40 +01:00
Add lint warning for $o->m()[0], not just f()[0]
Summary: We only caught half of this. Test Plan: Unit test. Reviewers: edward Reviewed By: edward CC: aran Maniphest Tasks: T1261 Differential Revision: https://secure.phabricator.com/D4920
This commit is contained in:
parent
2419718593
commit
42ae7cd92f
2 changed files with 9 additions and 0 deletions
|
@ -440,6 +440,7 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
|
||||||
$left = $index->getChildByIndex(0);
|
$left = $index->getChildByIndex(0);
|
||||||
switch ($left->getTypeName()) {
|
switch ($left->getTypeName()) {
|
||||||
case 'n_FUNCTION_CALL':
|
case 'n_FUNCTION_CALL':
|
||||||
|
case 'n_METHOD_CALL':
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$index->getChildByIndex(1),
|
$index->getChildByIndex(1),
|
||||||
self::LINT_PHP_54_FEATURES,
|
self::LINT_PHP_54_FEATURES,
|
||||||
|
|
8
src/lint/linter/__tests__/xhpast/php54.lint-test
Normal file
8
src/lint/linter/__tests__/xhpast/php54.lint-test
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
f()[0];
|
||||||
|
$o->m()[0];
|
||||||
|
|
||||||
|
~~~~~~~~~~
|
||||||
|
disabled:3:5
|
||||||
|
disabled:4:9
|
Loading…
Add table
Reference in a new issue