| Total Complexity | 4 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | final class ReplaceValue implements DataModifierInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var int|string|null |
||
| 11 | */ |
||
| 12 | private $key = null; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var mixed |
||
| 16 | */ |
||
| 17 | private $value = null; |
||
| 18 | |||
| 19 | public function apply(array $data): array |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param int|string $key |
||
| 29 | * @return self |
||
| 30 | */ |
||
| 31 | public function forKey($key): self |
||
| 32 | { |
||
| 33 | $new = clone $this; |
||
| 34 | $new->key = $key; |
||
| 35 | return $new; |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @param mixed $value |
||
| 40 | * @return self |
||
| 41 | */ |
||
| 42 | public function toValue($value): self |
||
| 47 | } |
||
| 48 | } |
||
| 49 |