-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Improve type inference for plugin manager #56
Conversation
Signed-off-by: George Steel <[email protected]>
Signed-off-by: George Steel <[email protected]>
…anges Signed-off-by: George Steel <[email protected]>
4f0f815
to
c3d0f02
Compare
@@ -87,16 +87,16 @@ | |||
}, | |||
{ | |||
"name": "laminas/laminas-servicemanager", | |||
"version": "3.11.2", | |||
"version": "3.12.0", |
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.
We should bump in composer.json
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.
Done… I figured the lock would cover it. Is it generally a good idea to bump minimums when adding psalm types not present in older versions?
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 think bumping is always a good idea, when it brings some goodies with it :D
Signed-off-by: George Steel <[email protected]>
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.
Thanks @gsteel!
After this change we got a lot of PHPStan errors. Return type (array) of method Application\Form\Fieldset\File::getInputFilterSpecification() should be compatible with return type (*NEVER*) of method
Laminas\InputFilter\InputFilterProviderInterface::getInputFilterSpecification()
public function getInputFilterSpecification(): array
{
return [...];
} |
@FabianKoestring can you please make a reproducer snippet on https://phpstan.org/try ? |
Also, please do so in a new issue :) |
I would do that but I don't know how to set dependencies (to |
@FabianKoestring copy in all symbols that affect your issue, and reduce the example to the minimum size to show the issue. |
👍 Look at error on line 62. https://phpstan.org/r/91e0e318-0ada-4777-9e50-983a0d7678a1
|
Simplifying your example further, it looks like phpstan doesn't understand this syntax:
See https://phpstan.org/r/6e758234-f4ef-4ff6-8519-919f3c9297e4 I would report an issue in upstream |
@gsteel |
The problem with the At the expense of allowing integer keys, the type could be It currently seems to me that the intersection type is the right thing but I'd gladly learn of a better/more precise way to represent this… |
Description
If laminas/laminas-servicemanager#137 gets merged, this is what I had in mind for
inputfilter
,filter
,validator
andview
… and others??