| Conditions | 3 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 3 | public function decode(string $data): array |
|
| 27 | { |
||
| 28 | 3 | $rawData = []; |
|
| 29 | 3 | parse_str($data, $rawData); |
|
| 30 | |||
| 31 | 3 | if ('' !== $data && [] === $rawData) { |
|
| 32 | 1 | throw DeserializerRuntimeException::createNotParsable($this->getContentType()); |
|
| 33 | } |
||
| 34 | |||
| 35 | 2 | return $this->fixValues($rawData); |
|
|
|
|||
| 36 | } |
||
| 37 | |||
| 89 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.