1 | <?php |
||
22 | final class RequestConfigurationFactory implements RequestConfigurationFactoryInterface |
||
23 | { |
||
24 | const API_VERSION_HEADER = 'Accept'; |
||
25 | const API_GROUPS_HEADER = 'Accept'; |
||
26 | |||
27 | const API_VERSION_REGEXP = '/(v|version)=(?P<version>[0-9\.]+)/i'; |
||
28 | const API_GROUPS_REGEXP = '/(g|groups)=(?P<groups>[a-z,_\s]+)/i'; |
||
29 | |||
30 | /** |
||
31 | * @var ParametersParserInterface |
||
32 | */ |
||
33 | private $parametersParser; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | private $configurationClass; |
||
39 | |||
40 | /** |
||
41 | * @var array |
||
42 | */ |
||
43 | private $defaultParameters; |
||
44 | |||
45 | /** |
||
46 | * @param ParametersParserInterface $parametersParser |
||
47 | * @param string $configurationClass |
||
48 | * @param array $defaultParameters |
||
49 | */ |
||
50 | public function __construct(ParametersParserInterface $parametersParser, $configurationClass, array $defaultParameters = []) |
||
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | */ |
||
60 | public function create(MetadataInterface $metadata, Request $request) |
||
67 | |||
68 | /** |
||
69 | * @param Request $request |
||
70 | * |
||
71 | * @return array |
||
72 | * |
||
73 | * @throws \InvalidArgumentException |
||
74 | */ |
||
75 | private function parseApiParameters(Request $request) |
||
95 | } |
||
96 |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.