1 | <?php |
||
7 | final class UrlEncodedDecoderType implements DecoderTypeInterface |
||
8 | { |
||
9 | /** |
||
10 | * @return string |
||
11 | */ |
||
12 | 2 | public function getContentType(): string |
|
16 | |||
17 | /** |
||
18 | * @param string $data |
||
19 | * |
||
20 | * @return array |
||
21 | * |
||
22 | * @throws DecoderException |
||
23 | */ |
||
24 | 2 | public function decode(string $data): array |
|
35 | |||
36 | /** |
||
37 | * @param array $rawData |
||
38 | * |
||
39 | * @return array |
||
40 | */ |
||
41 | 1 | private function fixValues(array $rawData): array |
|
56 | |||
57 | /** |
||
58 | * @param $value |
||
59 | * |
||
60 | * @return float|int|null|string |
||
61 | */ |
||
62 | 1 | private function fixValue($value) |
|
78 | } |
||
79 |
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.