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
DX: add types to anonymous functions #7561
DX: add types to anonymous functions #7561
Conversation
@@ -308,7 +308,7 @@ private function isTypeSortable(TypeAnalysis $type): bool | |||
*/ | |||
private function collectDisjunctiveNormalFormTypes(string $type): array | |||
{ | |||
$types = array_map(static function ($subType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any SCA to prevent adding another not-typed lambdas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've spotted these with slam/phpstan-extensions but was not able to fix all of the types (some lambdas need multiple types and with PHP 7.4 we cannot have them).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kubawerlos
maybe for those cases we can add mixed
typehint, and prevent adding any more untyped lambdas?
then, we deal with mixed
afterwars
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely, as soon as we drop PHP 7.4 support.
No description provided.