You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make collect() helper consistent with new Collection() (#45401)
Even though using `null` and `[]` as argument produce the same result, syntactically they are different as PHPStan is unable to infer template types when `null` is passed.
Currently when using `collect()` PHPStan will report these errors (as seen in larastan issue larastan/larastan#1115):
```
Unable to resolve the template type TKey in call to function collect
Unable to resolve the template type TValue in call to function collect
```
As a workaround you either have to explicitly pass empty array `collect([])` or use `new Collection()`.
I'm not sure if this is considered breaking BC or not.
I tried searching for existing issue/PR regarding this, but couldn't find anything. I apologize if this was addressed and declined already.
0 commit comments