for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Helldar\LaravelLangPublisher\Support;
use Helldar\Support\Facades\Helpers\Arr as ArrHelper;
use Illuminate\Contracts\Support\Arrayable;
class ArrayProcessor implements Arrayable
{
protected $items = [];
public function of(array $items): self
$this->items = $items;
return $this;
}
public function push($value): self
array_push($this->items, $value);
public function unique(): self
$this->items = array_unique($this->items);
public function values(): self
$this->items = array_values($this->items);
public function sort(): self
$this->items = ArrHelper::sort($this->items);
public function filter(callable $callback): self
$this->items = array_filter($this->items, $callback);
public function toArray(): array
return $this->items;