1 | <?php |
||
9 | class ConfigurationParser extends AbstractCpParser |
||
10 | { |
||
11 | /** |
||
12 | * @var UrlTransformer |
||
13 | */ |
||
14 | protected $urlTransformer; |
||
15 | |||
16 | /** |
||
17 | * @param string $url |
||
18 | * |
||
19 | * @return string |
||
20 | * @throws \Exception |
||
21 | */ |
||
22 | public function parseToJson($url) |
||
40 | |||
41 | /** |
||
42 | * @param UrlTransformer $urlTransformer |
||
43 | */ |
||
44 | public function setUrlTransformer(UrlTransformer $urlTransformer) |
||
48 | } |
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.