| Total Complexity | 10 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 3 | ||
| Bugs | 2 | Features | 0 |
| 1 | <?php |
||
| 17 | trait MutatorTrait |
||
| 18 | { |
||
| 19 | public function __set($index, $value) |
||
| 22 | } |
||
| 23 | |||
| 24 | 3 | public function set(string $index, mixed $value): static |
|
| 28 | } |
||
| 29 | 5 | ||
| 30 | public function bind(string $index, mixed &$variable): static |
||
| 31 | 5 | { |
|
| 32 | $this->storage[$index] = &$variable; |
||
| 33 | 5 | return $this; |
|
| 34 | } |
||
| 35 | |||
| 36 | 1 | public function upsert(string $index, mixed $value): static |
|
| 39 | } |
||
| 40 | 1 | ||
| 41 | public function pull(string $index, mixed $default = null): mixed |
||
| 42 | { |
||
| 43 | 1 | $value = $this->get($index, $default); |
|
| 44 | unset($this->storage[$index]); |
||
| 45 | 1 | return $value; |
|
| 46 | } |
||
| 47 | |||
| 48 | 1 | public function import(array $array): static |
|
| 49 | { |
||
| 50 | 1 | foreach ($array as $index => $value) { |
|
| 51 | 1 | $this->storage[$index] = $value; |
|
| 52 | } |
||
| 53 | 1 | return $this; |
|
| 54 | } |
||
| 55 | |||
| 56 | 18 | public function delete(string $index): static |
|
| 57 | { |
||
| 58 | 18 | unset($this->storage[$index]); |
|
| 59 | 17 | return $this; |
|
| 60 | } |
||
| 61 | |||
| 62 | 18 | public function clear(): static |
|
| 66 | } |
||
| 67 | } |
||
| 68 |