diff --git a/src/Collection/CollectionInterface.php b/src/Collection/CollectionInterface.php index b1f39be45af..632d0f2dc71 100644 --- a/src/Collection/CollectionInterface.php +++ b/src/Collection/CollectionInterface.php @@ -483,7 +483,7 @@ public function sample($size = 10); public function take($size = 1, $from = 0); /** - * Returns a new collection that will the specified amount of elements. + * Returns a new collection that will skip the specified amount of elements * at the beginning of the iteration. * * @param int $howMany The number of elements to skip. @@ -540,7 +540,7 @@ public function first(); /** * Returns the last result in this collection * - * @return mixed The first value in the collection will be returned. + * @return mixed The last value in the collection will be returned. */ public function last(); @@ -874,7 +874,7 @@ public function zip($items); * * ``` * $collection = new Collection([1, 2]); - * $zipped = $collection->zip([3, 4], [5, 6], function () { + * $zipped = $collection->zipWith([3, 4], [5, 6], function () { * return array_sum(func_get_args()); * }); * $zipped->toList(); // returns [9, 12]; [(1 + 3 + 5), (2 + 4 + 6)] diff --git a/src/Collection/Iterator/ZipIterator.php b/src/Collection/Iterator/ZipIterator.php index aea8ef9b949..8e70ff79e31 100644 --- a/src/Collection/Iterator/ZipIterator.php +++ b/src/Collection/Iterator/ZipIterator.php @@ -24,21 +24,23 @@ * * ### Example * - * {{{ + * ``` * $iterator = new ZipIterator([[1, 2], [3, 4]]); * $iterator->toList(); // Returns [[1, 3], [2, 4]] - * }}} + * ``` * * You can also chose a custom function to zip the elements together, such * as doing a sum by index: * * ### Example - * {{{ + * + * ``` * $iterator = new ZipIterator([[1, 2], [3, 4]], function ($a, $b) { * return $a + $b; * }); - * $iterator->toList(); // Returns [3, 6] - * }}} + * $iterator->toList(); // Returns [4, 6] + * ``` + * */ class ZipIterator extends MultipleIterator implements CollectionInterface {