Skip to content

List todos #8185

@ondrejmirtes

Description

@ondrejmirtes

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 into list<X> should be reported on level 3 - it can never be true. This needs to be tested on property assignments.
    • array<int, X> going into list<X> needs to be reported on level 7
    • list<string|null> going into list<string> needs to be reported on level 8
  • I suspect there might something wrong with covariance checking. Basically list<string> is a subtype of array<int, string>. So in parent method return type if there's array<int, string> and list<string> in a child class it should not be reported
    • But if there's list<string> in parent method and array<int, string> in child method then it should be reported.
    • If it already works correctly there should still be a test for this.
  • 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 about unset.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions