Closed dennis-koster closed 7 years ago
Hmm.. The problem with this is that the method does not actually return anything implementing that interface. This would help the IDE, but at the cost of lying about the return value.
This is the direct effect of the fact that the Illuminate paginator class does not have its own interface.
I think it would be better to add the LengthAwarePaginator itself to the @return
clause. That would be correct and help the IDE.
The
paginate()
method of the BaseRepository class returnsIlluminate\Contracts\Pagination\LengthAwarePaginator
as the interface in the docblock. However, that interface is incomplete, because the actualIlluminate\Pagination\LengthAwarePaginator
class implement many more methods, such ascount()
.