Skip to content

Conversation

@dennis-koster
Copy link

The paginate() method of the BaseRepository class returns Illuminate\Contracts\Pagination\LengthAwarePaginator as the interface in the docblock. However, that interface is incomplete, because the actual Illuminate\Pagination\LengthAwarePaginator class implement many more methods, such as count().

@czim
Copy link
Owner

czim commented Jun 13, 2017

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.

@czim czim closed this Nov 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants