-
-
Notifications
You must be signed in to change notification settings - Fork 930
Closed
Description
Bug report
We use PHPStan in combination with Laravel a lot and noticed that the static
return type on the make
method on a child class of Collection
(which the make
method is declared on) evaluates to Collection
as return type, and not the child class.
This seems like unwanted behaviour and can't find a mistake in the phpdocs. Please correct me if I'm wrong tho.
PS: In Laravel the make method is on a trait, at first I thought that was the issue. It seems to however also not work when the method is on the base class, that's why I submitted it like this.
Code snippet that reproduces the problem
https://phpstan.org/r/f747641a-9d84-4349-9a34-510022e3e8e2
Expected output
Dumped type: EloquentCollection<NEVER, NEVER>
Did PHPStan help you today? Did it make you happy in any way?
It helps me everyday spotting little things I would oversee
Metadata
Metadata
Assignees
Labels
No labels