Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15399647
D12828.id30907.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12828.id30907.diff
View Options
diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php
--- a/src/lint/linter/ArcanistXHPASTLinter.php
+++ b/src/lint/linter/ArcanistXHPASTLinter.php
@@ -3788,9 +3788,13 @@
$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
--- 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 @@
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
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 18, 6:26 AM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7549413
Default Alt Text
D12828.id30907.diff (1 KB)
Attached To
Mode
D12828: Improve linter rule for useless overriding methods
Attached
Detach File
Event Timeline
Log In to Comment