| 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 | 2 | public function __construct(string $numericPrefix = '', string $argSeperator = '&') |
|
| 28 | |||
| 29 | /** |
||
| 30 | * @param string $string |
||
| 31 | * |
||
| 32 | * @return array |
||
| 33 | */ |
||
| 34 | 2 | public function transform(string $string): array |
|
| 41 | |||
| 42 | /** |
||
| 43 | * @param array $rawData |
||
| 44 | * @param int $numericPrefixLength |
||
| 45 | * |
||
| 46 | * @return array |
||
| 47 | */ |
||
| 48 | 2 | private function cleanRawData(array $rawData, int $numericPrefixLength): array |
|
| 70 | } |
||
| 71 |
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.