1 | <?php |
||
21 | class GenericReducer implements ReducerInterface |
||
22 | { |
||
23 | /** |
||
24 | * @param RuleInterface $rule |
||
25 | * @return bool |
||
26 | */ |
||
27 | public function match(RuleInterface $rule): bool |
||
31 | |||
32 | /** |
||
33 | * @param RuleInterface $rule |
||
34 | * @return \Generator|Matchable |
||
35 | */ |
||
36 | public function reduce(RuleInterface $rule): \Generator |
||
49 | } |
||
50 |
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.