*/
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());
}
/**
*/
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));
}
/**
*/
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
{
}
return array_map(function ($array) {
- return new static($array);
+ return new self($array);
}, array_chunk($this->getArrayCopy(), $length));
}