-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
Labels
Description
Feature request
- I suspect this phpstan/phpstan-src@d281214 might have broken levels handling. I expect this behaviour so it should be tested and fixed:
array<string, X>going intolist<X>should be reported on level 3 - it can never be true. This needs to be tested on property assignments.array<int, X>going intolist<X>needs to be reported on level 7list<string|null>going intolist<string>needs to be reported on level 8
- I suspect there might something wrong with covariance checking. Basically
list<string>is a subtype ofarray<int, string>. So in parent method return type if there'sarray<int, string>andlist<string>in a child class it should not be reported- But if there's
list<string>in parent method andarray<int, string>in child method then it should be reported. - If it already works correctly there should still be a test for this.
- But if there's
- Test for things I mentioned in comment Implement array list type phpstan-src#1751 (review). The
AccessoryArrayListType::unsetOffset()is wrong I think in regard to what I said aboutunset.