| Total Complexity | 11 |
| Total Lines | 72 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class ArrayProcessor implements Arrayable |
||
| 9 | { |
||
| 10 | protected $items = []; |
||
| 11 | |||
| 12 | protected $keys_as_string = false; |
||
| 13 | |||
| 14 | public function keysAsString(): self |
||
| 15 | { |
||
| 16 | $this->keys_as_string = true; |
||
| 17 | |||
| 18 | return $this; |
||
| 19 | } |
||
| 20 | |||
| 21 | public function of(array $items): self |
||
| 26 | } |
||
| 27 | |||
| 28 | public function push($value): self |
||
| 29 | { |
||
| 30 | array_push($this->items, $value); |
||
| 31 | |||
| 32 | return $this; |
||
| 33 | } |
||
| 34 | |||
| 35 | public function merge(array $array): self |
||
| 44 | } |
||
| 45 | |||
| 46 | public function unique(): self |
||
| 51 | } |
||
| 52 | |||
| 53 | public function values(): self |
||
| 54 | { |
||
| 55 | $this->items = array_values($this->items); |
||
| 56 | |||
| 57 | return $this; |
||
| 58 | } |
||
| 59 | |||
| 60 | public function sort(): self |
||
| 61 | { |
||
| 62 | $this->items = ArrHelper::sort($this->items); |
||
| 63 | |||
| 64 | return $this; |
||
| 65 | } |
||
| 66 | |||
| 67 | public function toArray(): array |
||
| 68 | { |
||
| 69 | return $this->items; |
||
| 70 | } |
||
| 71 | |||
| 72 | protected function stringingKeys(array $array): array |
||
| 80 | }); |
||
| 81 | } |
||
| 82 | } |
||
| 83 |