1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-22 23:02:41 +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:
epriestley 2013-02-12 07:07:35 -08:00
parent 2419718593
commit 42ae7cd92f
2 changed files with 9 additions and 0 deletions

View file

@ -440,6 +440,7 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
$left = $index->getChildByIndex(0);
switch ($left->getTypeName()) {
case 'n_FUNCTION_CALL':
case 'n_METHOD_CALL':
$this->raiseLintAtNode(
$index->getChildByIndex(1),
self::LINT_PHP_54_FEATURES,

View file

@ -0,0 +1,8 @@
<?php
f()[0];
$o->m()[0];
~~~~~~~~~~
disabled:3:5
disabled:4:9