diff --git a/src/BaseCollection.php b/src/BaseCollection.php index 407448fc5a..9598b1ae78 100644 --- a/src/BaseCollection.php +++ b/src/BaseCollection.php @@ -89,7 +89,7 @@ class BaseCollection extends \ArrayIterator */ public function map(callable $callback): BaseCollection { - return new static(array_map($callback, $this->getArrayCopy()), $this->getTotalCount()); + return new self(array_map($callback, $this->getArrayCopy()), $this->getTotalCount()); } /** @@ -102,7 +102,7 @@ class BaseCollection extends \ArrayIterator */ public function filter(callable $callback = null, int $flag = 0): BaseCollection { - return new static(array_filter($this->getArrayCopy(), $callback, $flag)); + return new self(array_filter($this->getArrayCopy(), $callback, $flag)); } /** @@ -112,14 +112,14 @@ class BaseCollection extends \ArrayIterator */ public function reverse(): BaseCollection { - return new static(array_reverse($this->getArrayCopy()), $this->getTotalCount()); + return new self(array_reverse($this->getArrayCopy()), $this->getTotalCount()); } /** * Split the collection in smaller collections no bigger than the provided length * * @param int $length - * @return static[] + * @return self[] */ public function chunk(int $length): array { @@ -128,7 +128,7 @@ class BaseCollection extends \ArrayIterator } return array_map(function ($array) { - return new static($array); + return new self($array); }, array_chunk($this->getArrayCopy(), $length)); }