Replies: 1 comment
-
|
That's why we have an option to require it everywhere else, and ignore arrow functions :D https://mago.carthage.software/tools/linter/rules/correctness#return-type [linter.rules]
return-type = { ignore-arrow-function = true, ignore-closure = true } |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When writing using arrow functions or normal inline functions, there is often no need to add a parameter type and/or return type, if the things that you work with are already typed.
Consider
Why would I want to bloat my code with types here if
$listalready is properly typed? PHPStorm and PHPStan understand this.Since this is a linting error, I guess it does not look at types at all.
I think if this is a rule, it should be a
analyzerule that will complain when the type is unknown.Beta Was this translation helpful? Give feedback.
All reactions