Direct instantiation of ArrayObject assumes the collection is empty #8511
-
|
Refs: https://phpstan.org/r/fe034139-5b36-449e-a2fa-1898c370ff48 #6731 might be similar How am I supposed to directly use a collection like I'm asking because one of my open PRs (phpstan/phpstan-src#2058) changes behaviour there (additional error message in first method, see example) and that leads to a couple of new errors, e.g. in PHPUnit. And I'm wondering if this is all expected and I maybe should just open PRs to add the types to PHPUnit. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
It's hard to solve this. Because the default constructor parameter is To make this smarter, we'll have to implement this suggestion: #6732 (comment) (it's complicated but once we have control flow graph, it should be possible) |
Beta Was this translation helpful? Give feedback.
It's hard to solve this. Because the default constructor parameter is
[].To make this smarter, we'll have to implement this suggestion: #6732 (comment) (it's complicated but once we have control flow graph, it should be possible)