| Total Complexity | 6 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | final class InsertValueBeforeKey implements DataModifierInterface |
||
| 8 | { |
||
| 9 | private $key; |
||
| 10 | |||
| 11 | private $value; |
||
| 12 | |||
| 13 | private $beforeKey; |
||
| 14 | |||
| 15 | public function withKey($key): self |
||
| 16 | { |
||
| 17 | $new = clone $this; |
||
| 18 | $new->key = $key; |
||
| 19 | return $new; |
||
| 20 | } |
||
| 21 | |||
| 22 | public function setValue($value): self |
||
| 23 | { |
||
| 24 | $new = clone $this; |
||
| 25 | $new->value = $value; |
||
| 26 | return $new; |
||
| 27 | } |
||
| 28 | |||
| 29 | public function beforeKey($key): self |
||
| 30 | { |
||
| 31 | $new = clone $this; |
||
| 32 | $new->beforeKey = $key; |
||
| 33 | return $new; |
||
| 34 | } |
||
| 35 | |||
| 36 | |||
| 37 | public function apply(array $data): array |
||
| 48 | } |
||
| 49 | } |
||
| 50 |