BabDev / Pagerfanta

Pagination library for PHP applications with support for several data providers
Other
381 stars 170 forks source link

CollectionAdapter typehint #56

Closed kor3k closed 2 months ago

kor3k commented 5 months ago

i think the CollectionAdapter constructor

Pagerfanta\Doctrine\Collections\CollectionAdapter::__construct(Collection $collection)

should be typehinted to ReadableCollection instead of Collection.
that's what Doctrine\Common\Collections\Selectable::matching() is typehinted to as well. and both ::slice() and ::count() used in the adapter come from ReadableCollection.

not a big deal, i don't know if any class actually does implement just ReadableCollection and not Collection, but still.

mbabker commented 5 months ago

Feel free to send a PR in for it. I know the readable interface is relatively new compared to either the adapter here or the collections package as a whole, so it's just one of those cases where things haven't been updated to use it.