Skip to content

Add stub for VoterInterface #291

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

Merged
merged 1 commit into from
Aug 5, 2022
Merged

Conversation

yguedidi
Copy link
Contributor

To type the $attributes with mixed[] instead of array to be OK until level 9 at least

@herndlm
Copy link
Contributor

herndlm commented Jul 15, 2022

Sorry if that's a stupid question, but is that something that could be done in symfony itself too? Or are they not accepting this?

@ondrejmirtes
Copy link
Member

  1. Needs to be registered in stubFiles.
  2. What error are you trying to prevent?

@yguedidi
Copy link
Contributor Author

@ondrejmirtes

  1. updated
  2. this error: "Method FooVoter::vote() has parameter $attributes with no value type specified in iterable type array." from level 6

@yguedidi
Copy link
Contributor Author

but is that something that could be done in symfony itself too? Or are they not accepting this?

@stof what do you think about this?

@stof
Copy link
Contributor

stof commented Jul 15, 2022

This might be accepted in Symfony (I would vote for it, but not sure about the rest of the core team).

I think one issue is that PHPStorm has a suggestion (enabled in its default config) to replace it with array as being equivalent.

@stof
Copy link
Contributor

stof commented Jul 15, 2022

Note also that this would probably be applied only in the next version of Symfony (as all other type improvements), so the stub might still be useful for the Symfony 5.4 LTS.

@yguedidi
Copy link
Contributor Author

yguedidi commented Aug 3, 2022

@ondrejmirtes any news here?

@ondrejmirtes ondrejmirtes merged commit f4cb3b8 into phpstan:1.2.x Aug 5, 2022
@ondrejmirtes
Copy link
Member

Thank you.

@yguedidi yguedidi deleted the voter-stub branch August 5, 2022 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants