]> git.mxchange.org Git - friendica.git/commitdiff
Fix wrong use of static
authorArt4 <art4@wlabs.de>
Mon, 4 Nov 2024 13:46:33 +0000 (13:46 +0000)
committerArt4 <art4@wlabs.de>
Mon, 4 Nov 2024 13:46:33 +0000 (13:46 +0000)
src/BaseCollection.php

index 407448fc5a07cf4e97771bb2fe3728487d4915e8..9598b1ae7802d699b629bf252c29eed453bccd77 100644 (file)
@@ -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));
        }