Pagerfanta icon indicating copy to clipboard operation
Pagerfanta copied to clipboard

CollectionAdapter typehint

Open kor3k opened this issue 1 year ago • 1 comments

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.

kor3k avatar May 17 '24 15:05 kor3k

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.

mbabker avatar May 17 '24 16:05 mbabker