@@ -88,7 +88,7 @@ collection immediately applying the callback to each value in the collection.
8888
8989### map()
9090
91- ` method ` Cake\\ Collection\\ Collection::** map** ($callback)
91+ ` method ` Cake\\ Collection\\ Collection::** map** ($callback): CollectionInterface
9292
9393The ` map() ` method will create a new collection based on the output of the
9494callback being applied to each object in the original collection:
@@ -113,7 +113,7 @@ the resulting items when iterated.
113113
114114### extract()
115115
116- ` method ` Cake\\ Collection\\ Collection::** extract** ($path)
116+ ` method ` Cake\\ Collection\\ Collection::** extract** ($path): CollectionInterface
117117
118118One of the most common uses for a ` map() ` function is to extract a single
119119column from a collection. If you are looking to build a list of elements
@@ -188,7 +188,7 @@ Unlike `Cake\Utility\Hash::extract()` this method only supports the
188188
189189### combine()
190190
191- ` method ` Cake\\ Collection\\ Collection::** combine** ($keyPath, $valuePath, $groupPath = null)
191+ ` method ` Cake\\ Collection\\ Collection::** combine** ($keyPath, $valuePath, $groupPath = null): CollectionInterface
192192
193193Collections allow you to create a new collection made from keys and values in
194194an existing collection. Both the key and value paths can be specified with
@@ -245,7 +245,7 @@ $combined = (new Collection($entities))->combine(
245245
246246### stopWhen()
247247
248- ` method ` Cake\\ Collection\\ Collection::** stopWhen** (callable $c)
248+ ` method ` Cake\\ Collection\\ Collection::** stopWhen** (callable $c): CollectionInterface
249249
250250You can stop the iteration at any point using the ` stopWhen() ` method. Calling
251251it in a collection will create a new one that will stop yielding results if the
@@ -266,7 +266,7 @@ $result = $new->toList();
266266
267267### unfold()
268268
269- ` method ` Cake\\ Collection\\ Collection::** unfold** (callable $callback)
269+ ` method ` Cake\\ Collection\\ Collection::** unfold** (callable $callback): CollectionInterface
270270
271271Sometimes the internal items of a collection will contain arrays or iterators
272272with more items. If you wish to flatten the internal structure to iterate once
@@ -314,7 +314,7 @@ $result = $new->toList();
314314
315315### chunk()
316316
317- ` method ` Cake\\ Collection\\ Collection::** chunk** ($chunkSize)
317+ ` method ` Cake\\ Collection\\ Collection::** chunk** ($chunkSize): CollectionInterface
318318
319319When dealing with large amounts of items in a collection, it may make sense to
320320process the elements in batches instead of one by one. For splitting
@@ -345,7 +345,7 @@ $collection->map(function ($article) {
345345
346346### chunkWithKeys()
347347
348- ` method ` Cake\\ Collection\\ Collection::** chunkWithKeys** ($chunkSize)
348+ ` method ` Cake\\ Collection\\ Collection::** chunkWithKeys** ($chunkSize): CollectionInterface
349349
350350Much like ` chunk() ` , ` chunkWithKeys() ` allows you to slice up
351351a collection into smaller batches but with keys preserved. This is useful when
@@ -372,7 +372,7 @@ $result = $chunked->toList();
372372
373373### filter()
374374
375- ` method ` Cake\\ Collection\\ Collection::** filter** ($callback)
375+ ` method ` Cake\\ Collection\\ Collection::** filter** ($callback): CollectionInterface
376376
377377Collections allow you to filter and create new collections based on
378378the result of callback functions. You can use ` filter() ` to create a new
@@ -390,7 +390,7 @@ $guys = $collection->filter(function ($person, $key) {
390390
391391### reject()
392392
393- ` method ` Cake\\ Collection\\ Collection::** reject** (callable $c)
393+ ` method ` Cake\\ Collection\\ Collection::** reject** (callable $c): CollectionInterface
394394
395395The inverse of ` filter() ` is ` reject() ` . This method does a negative filter,
396396removing elements that match the filter function:
@@ -439,7 +439,7 @@ $hasYoungPeople = $collection->any(function ($person) {
439439
440440### match()
441441
442- ` method ` Cake\\ Collection\\ Collection::** match** ($conditions)
442+ ` method ` Cake\\ Collection\\ Collection::** match** ($conditions): CollectionInterface
443443
444444If you need to extract a new collection containing only the elements that
445445contain a given set of properties, you should use the ` match() ` method:
@@ -602,7 +602,7 @@ $median = (new Collection($items))->median('invoice.total');
602602
603603### groupBy()
604604
605- ` method ` Cake\\ Collection\\ Collection::** groupBy** ($callback)
605+ ` method ` Cake\\ Collection\\ Collection::** groupBy** ($callback): CollectionInterface
606606
607607Collection values can be grouped by different keys in a new collection when they
608608share the same value for a property:
@@ -644,7 +644,7 @@ $classResults = $students->groupBy(function ($student) {
644644
645645### countBy()
646646
647- ` method ` Cake\\ Collection\\ Collection::** countBy** ($callback)
647+ ` method ` Cake\\ Collection\\ Collection::** countBy** ($callback): CollectionInterface
648648
649649If you only wish to know the number of occurrences per group, you can do so by
650650using the ` countBy() ` method. It takes the same arguments as ` groupBy ` so it
@@ -661,7 +661,7 @@ $classResults = $students->countBy(function ($student) {
661661
662662### indexBy()
663663
664- ` method ` Cake\\ Collection\\ Collection::** indexBy** ($callback)
664+ ` method ` Cake\\ Collection\\ Collection::** indexBy** ($callback): CollectionInterface
665665
666666There will be certain cases where you know an element is unique for the property
667667you want to group by. If you wish a single result per group, you can use the
@@ -691,7 +691,7 @@ $filesByHash = $files->indexBy(function ($file) {
691691
692692### zip()
693693
694- ` method ` Cake\\ Collection\\ Collection::** zip** ($items)
694+ ` method ` Cake\\ Collection\\ Collection::** zip** ($items): CollectionInterface
695695
696696The elements of different collections can be grouped together using the
697697` zip() ` method. It will return a new collection containing an array grouping
@@ -750,7 +750,7 @@ $result = $firstYear->zip($data[0], $data[1])->toList();
750750
751751### sortBy()
752752
753- ` method ` Cake\\ Collection\\ Collection::** sortBy** ($callback, $order = SORT_DESC, $sort = SORT_NUMERIC)
753+ ` method ` Cake\\ Collection\\ Collection::** sortBy** ($callback, $order = SORT_DESC, $sort = SORT_NUMERIC): CollectionInterface
754754
755755Collection values can be sorted in ascending or descending order based on
756756a column or custom function. To create a new sorted collection out of the values
@@ -818,7 +818,7 @@ $sorted = $collection->sortBy('title', SORT_ASC, SORT_NATURAL);
818818
819819### nest()
820820
821- ` method ` Cake\\ Collection\\ Collection::** nest** ($idPath, $parentPath, $nestingKey = 'children')
821+ ` method ` Cake\\ Collection\\ Collection::** nest** ($idPath, $parentPath, $nestingKey = 'children'): CollectionInterface
822822
823823Not all data is meant to be represented in a linear way. Collections make it
824824easier to construct and flatten hierarchical or nested structures. Creating
@@ -870,7 +870,7 @@ rendering menus or traversing elements up to certain level in the tree.
870870
871871### listNested()
872872
873- ` method ` Cake\\ Collection\\ Collection::** listNested** ($order = 'desc', $nestingKey = 'children')
873+ ` method ` Cake\\ Collection\\ Collection::** listNested** ($order = 'desc', $nestingKey = 'children'): CollectionInterface
874874
875875The inverse of ` nest() ` is ` listNested() ` . This method allows you to flatten
876876a tree structure back into a linear structure. It takes two parameters; the
@@ -977,7 +977,7 @@ comparison types you can use the `some()` method.
977977
978978### shuffle()
979979
980- ` method ` Cake\\ Collection\\ Collection::** shuffle** ()
980+ ` method ` Cake\\ Collection\\ Collection::** shuffle** (): CollectionInterface
981981
982982Sometimes you may wish to show a collection of values in a random order. In
983983order to create a new collection that will return each value in a randomized
@@ -992,7 +992,7 @@ $collection->shuffle()->toList();
992992
993993### transpose()
994994
995- ` method ` Cake\\ Collection\\ Collection::** transpose** ()
995+ ` method ` Cake\\ Collection\\ Collection::** transpose** (): CollectionInterface
996996
997997When you transpose a collection, you get a new collection containing a row made
998998of the each of the original columns:
@@ -1020,7 +1020,7 @@ $result = $transpose->toList();
10201020
10211021### sample()
10221022
1023- ` method ` Cake\\ Collection\\ Collection::** sample** ($length = 10)
1023+ ` method ` Cake\\ Collection\\ Collection::** sample** ($length = 10): CollectionInterface
10241024
10251025Shuffling a collection is often useful when doing quick statistical analysis.
10261026Another common operation when doing this sort of task is withdrawing a few
@@ -1041,7 +1041,7 @@ sample, the full collection in a random order is returned.
10411041
10421042### take()
10431043
1044- ` method ` Cake\\ Collection\\ Collection::** take** ($length, $offset)
1044+ ` method ` Cake\\ Collection\\ Collection::** take** ($length, $offset): CollectionInterface
10451045
10461046Whenever you want to take a slice of a collection use the ` take() ` function,
10471047it will create a new collection with at most the number of values you specify in
@@ -1058,7 +1058,7 @@ Positions are zero-based, therefore the first position number is `0`.
10581058
10591059### skip()
10601060
1061- ` method ` Cake\\ Collection\\ Collection::** skip** ($length)
1061+ ` method ` Cake\\ Collection\\ Collection::** skip** ($length): CollectionInterface
10621062
10631063While the second argument of ` take() ` can help you skip some elements before
10641064getting them from the collection, you can also use ` skip() ` for the same
@@ -1098,7 +1098,7 @@ $collection->last(); // Returns 2
10981098
10991099### append()
11001100
1101- ` method ` Cake\\ Collection\\ Collection::** append** (array|Traversable $items)
1101+ ` method ` Cake\\ Collection\\ Collection::** append** (array|Traversable $items): CollectionInterface
11021102
11031103You can compose multiple collections into a single one. This enables you to
11041104gather data from various sources, concatenate it, and apply other collection
@@ -1117,7 +1117,7 @@ $myTimeline->filter(function ($tweet) {
11171117
11181118### appendItem()
11191119
1120- ` method ` Cake\\ Collection\\ Collection::** appendItem** ($value, $key)
1120+ ` method ` Cake\\ Collection\\ Collection::** appendItem** ($value, $key): CollectionInterface
11211121
11221122Allows you to append an item with an optional key to the collection. If you
11231123specify a key that already exists in the collection, the value will not be
@@ -1130,7 +1130,7 @@ $myTimeline = $cakephpTweets->appendItem($newTweet, 99);
11301130
11311131### prepend()
11321132
1133- ` method ` Cake\\ Collection\\ Collection::** prepend** ($items)
1133+ ` method ` Cake\\ Collection\\ Collection::** prepend** ($items): CollectionInterface
11341134
11351135The ` prepend() ` method will return a new collection containing the values from
11361136both sources:
@@ -1142,7 +1142,7 @@ $myTimeline = $cakephpTweets->prepend($phpTweets);
11421142
11431143### prependItem()
11441144
1145- ` method ` Cake\\ Collection\\ Collection::** prependItem** ($value, $key)
1145+ ` method ` Cake\\ Collection\\ Collection::** prependItem** ($value, $key): CollectionInterface
11461146
11471147Allows you to prepend an item with an optional key to the collection. If you
11481148specify a key that already exists in the collection, the value will not be
@@ -1165,7 +1165,7 @@ $myTimeline = $cakephpTweets->prependItem($newTweet, 99);
11651165
11661166### insert()
11671167
1168- ` method ` Cake\\ Collection\\ Collection::** insert** ($path, $items)
1168+ ` method ` Cake\\ Collection\\ Collection::** insert** ($path, $items): CollectionInterface
11691169
11701170At times, you may have two separate sets of data that you would like to insert
11711171the elements of one set into each of the elements of the other set. This is
@@ -1287,7 +1287,7 @@ $collection->map(new TotalOrderCalculator)
12871287
12881288### through()
12891289
1290- ` method ` Cake\\ Collection\\ Collection::** through** ($callback)
1290+ ` method ` Cake\\ Collection\\ Collection::** through** ($callback): CollectionInterface
12911291
12921292Sometimes a chain of collection method calls can become reusable in other parts
12931293of your application, but only if they are called in that specific order. In
@@ -1328,7 +1328,7 @@ $collection->through(new FinalCheckOutRowProcessor);
13281328
13291329### buffered()
13301330
1331- ` method ` Cake\\ Collection\\ Collection::** buffered** ()
1331+ ` method ` Cake\\ Collection\\ Collection::** buffered** (): CollectionInterface
13321332
13331333Collections often perform most operations that you create using its functions in
13341334a lazy way. This means that even though you can call a function, it does not
@@ -1410,7 +1410,7 @@ $rewindable = (new Collection(results()))->buffered();
14101410
14111411### compile()
14121412
1413- ` method ` Cake\\ Collection\\ Collection::** compile** ($preserveKeys = true)
1413+ ` method ` Cake\\ Collection\\ Collection::** compile** ($preserveKeys = true): CollectionInterface
14141414
14151415Sometimes you need to get a clone of the elements from another
14161416collection. This is useful when you need to iterate the same set from different
0 commit comments