-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PSR2.Methods.FunctionCallSignature false positive when arrow function has array return type #2773
Comments
…hen arrow function has array return type
Thanks for the report. The fix will be in 3.5.4. |
When an arrow function with an array return value is the last function argument, this still reports an incorrect error. I have the following in my code: return $this->mapResults(
$dql,
fn (array $row) => [$row[0], $row[3]]
); |
@cl1ck You may want to open a new issue as 1) this is closed and 2) your issue is actually a different one. Your issue can be reproduced even without the Oh and the actual problem is in the |
I opened issue #2895 for the issue above. Someone else also commented on another closed issue with the same general problem. |
This might be related to #2523.
Using the file:
Produces the error:
This seems specific to an arrow function that has an
array
return type with a multiple argument function call in the body of the arrow function. Usingfn(string $n): string => bcadd($n, '3')
orfn(string $n): array => [$n, 3]
as the arrow function produces no error from phpcs.The text was updated successfully, but these errors were encountered: