diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php index 248e4399..380cbd8c 100644 --- a/src/lint/linter/ArcanistXHPASTLinter.php +++ b/src/lint/linter/ArcanistXHPASTLinter.php @@ -3788,9 +3788,13 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter { $parameters = array(); foreach ($parameter_list->getChildren() as $parameter) { - $parameters[] = $parameter - ->getChildOfType(1, 'n_VARIABLE') - ->getConcreteString(); + $parameter = $parameter->getChildByIndex(1); + + if ($parameter->getTypeName() == 'n_VARIABLE_REFERENCE') { + $parameter = $parameter->getChildOfType(0, 'n_VARIABLE'); + } + + $parameters[] = $parameter->getConcreteString(); } $statements = $method->getChildByIndex(5); diff --git a/src/lint/linter/__tests__/xhpast/useless-overriding-method.lint-test b/src/lint/linter/__tests__/xhpast/useless-overriding-method.lint-test index a6e2780f..308bf76f 100644 --- a/src/lint/linter/__tests__/xhpast/useless-overriding-method.lint-test +++ b/src/lint/linter/__tests__/xhpast/useless-overriding-method.lint-test @@ -12,8 +12,13 @@ final class MyClass extends SomeOtherClass { public function usefulMethod($x, array $y) { return parent::usefulMethod($x, null); } + + public function anotherMethod($x, &$y) { + return parent::anotherMethod($x, $y); + } } ~~~~~~~~~~ error:3:13 advice:4:3 advice:8:3 +advice:16:3