Skip to content
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

signature mismatch in IteratorAggregate #5218

Closed
staabm opened this issue Jun 25, 2021 · 4 comments
Closed

signature mismatch in IteratorAggregate #5218

staabm opened this issue Jun 25, 2021 · 4 comments

Comments

@staabm
Copy link
Contributor

staabm commented Jun 25, 2021

Bug report

shouldn't phpstan error because we pass a array<string, mixed> into ArrayIterator and therefore this doesn't match the @phpstan-implements IteratorAggregate<string, int> contract?

Code snippet that reproduces the problem

https://phpstan.org/r/d682c953-501a-4416-9211-893c6765f2bb

Expected output

a type mismatch error? I am not 100% sure, maybe its done intentionally like that?

@staabm
Copy link
Contributor Author

staabm commented Jun 25, 2021

in contrast, when using a explicit type a error is reported: https://phpstan.org/r/7d9d36ed-9601-435a-9249-f28c781c9a4a

@ondrejmirtes
Copy link
Member

You shouldn't use mixed at all if you want fully-typed codebase :)

Keeping this open because it should probably be reported with checkExplicitMixed: true.

@ondrejmirtes
Copy link
Member

Implemented: phpstan/phpstan-src@b4f81db

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants