From 57c188d01d2647b915a416ab55432ca10a9c5b5f Mon Sep 17 00:00:00 2001 From: Art4 Date: Mon, 4 Nov 2024 13:46:33 +0000 Subject: [PATCH] Fix wrong use of static --- src/BaseCollection.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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)); } -- 2.39.5