Bug report
When you implement IteratorAggregate with an ArrayIterator using a local array property, PHPStan does not understand that the ArrayIterator key type depends on the local array property key type. It complains that array key type string is returned when in fact the key type is non-empty-string and PHPStan should be able to infer that.
Code snippet that reproduces the problem
https://phpstan.org/r/fd46fa7a-e010-404d-95e1-72b562e2150f
Expected output
No errors
Did PHPStan help you today? Did it make you happy in any way?
No response
Bug report
When you implement IteratorAggregate with an ArrayIterator using a local array property, PHPStan does not understand that the ArrayIterator key type depends on the local array property key type. It complains that array key type string is returned when in fact the key type is non-empty-string and PHPStan should be able to infer that.
Code snippet that reproduces the problem
https://phpstan.org/r/fd46fa7a-e010-404d-95e1-72b562e2150f
Expected output
No errors
Did PHPStan help you today? Did it make you happy in any way?
No response