Conditions | 4 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
35 | public function isFiltered(Event $event, $ruleName, Response $response) |
||
36 | { |
||
37 | foreach ($this->filters as $filter) { |
||
38 | if ($ruleName === $filter['rule'] && 0 < preg_match($filter['uri'], (string)$response->getUri())) { |
||
39 | $event->setProcessed(); |
||
40 | return true; |
||
41 | } |
||
42 | } |
||
43 | |||
44 | return false; |
||
45 | } |
||
46 | } |
||
47 |
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.