You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** * @template TKey * @template T */interface Chunkable
{
/** * Chunk a collection of items into chunks of items of a given size. * * @see https://loophp-collection.readthedocs.io/en/stable/pages/api.html#chunk * * @return Collection<int, list<T>> */publicfunctionchunk(int ...$sizes): Collection;
}
As you can see, this operation returns Collection<int, list<T>>, which is fair.
Yet, since after applying chunk(), each produced chunk can will never be empty list.
Therefore, maybe it would make sense to specify Collection<int, non-empty-list<T>> as a return type, since this is more specific.
The text was updated successfully, but these errors were encountered:
Since this issue has not had any activity within the last 5 days, I have marked it as stale.
I will close it if no further activity occurs within the next 5 days.
Since this issue has not had any activity within the last 5 days, I have marked it as stale.
I will close it if no further activity occurs within the next 5 days.
Currently
Chunkable
interface looks like this:As you can see, this operation returns
Collection<int, list<T>>
, which is fair.Yet, since after applying
chunk()
, each produced chunk can will never be empty list.Therefore, maybe it would make sense to specify
Collection<int, non-empty-list<T>>
as a return type, since this is more specific.The text was updated successfully, but these errors were encountered: