| 1 | <?php | ||
| 28 | class CoreEventHandler implements EventListenerInterface | ||
| 29 | { | ||
| 30 | |||
| 31 | /** | ||
| 32 | * Returns a list of events this object is implementing. | ||
| 33 | * | ||
| 34 | * @return array | ||
| 35 | * @return void | ||
| 36 | */ | ||
| 37 | public function implementedEvents() | ||
| 43 | |||
| 44 | /** | ||
| 45 | * On controller setup. | ||
| 46 | * | ||
| 47 | * @param Event $event | ||
| 48 | * @return void | ||
| 49 | */ | ||
| 50 | public function onControllerSetup(Event $event) | ||
| 68 | } | ||
| 69 | 
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.