1 | <?php |
||
7 | final class UrlEncodedTransformer implements TransformerInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | private $numericPrefix; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $argSeperator; |
||
18 | |||
19 | /** |
||
20 | * @param string $numericPrefix |
||
21 | * @param string $argSeperator |
||
22 | */ |
||
23 | 4 | public function __construct(string $numericPrefix = '', string $argSeperator = '&') |
|
28 | |||
29 | /** |
||
30 | * @return string |
||
31 | */ |
||
32 | 1 | public function getContentType(): string |
|
36 | |||
37 | /** |
||
38 | * @param string $string |
||
39 | * |
||
40 | * @return array |
||
41 | */ |
||
42 | 3 | public function transform(string $string): array |
|
55 | |||
56 | /** |
||
57 | * @param array $rawData |
||
58 | * @param int $numericPrefixLength |
||
59 | * |
||
60 | * @return array |
||
61 | */ |
||
62 | 2 | private function cleanRawData(array $rawData, int $numericPrefixLength): array |
|
92 | } |
||
93 |
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.