| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | 263 | public function decode(Parser|string|int $value): mixed |
|
| 30 | { |
||
| 31 | 263 | if (!is_string($value)) { |
|
| 32 | 137 | return $value; |
|
| 33 | } |
||
| 34 | |||
| 35 | 258 | $decoded = $this->config->decoder->decode($value); |
|
| 36 | |||
| 37 | 258 | if (!$decoded->succeeded) { |
|
| 38 | 6 | ($this->config->onDecodingError)($decoded); |
|
| 39 | } |
||
| 40 | |||
| 41 | 257 | return $decoded->value; |
|
| 42 | } |
||
| 44 |