| Conditions | 5 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 59 | public function apply(array $data): array |
||
| 60 | { |
||
| 61 | if ($this->key === null || $this->beforeKey === null) { |
||
| 62 | return $data; |
||
| 63 | } |
||
| 64 | |||
| 65 | $result = []; |
||
| 66 | foreach ($data as $k => $v) { |
||
| 67 | if ($k === $this->beforeKey) { |
||
| 68 | $result[$this->key] = $this->value; |
||
| 69 | } |
||
| 70 | $result[$k] = $v; |
||
| 71 | } |
||
| 72 | |||
| 73 | return $result; |
||
| 74 | } |
||
| 76 |