| Conditions | 3 |
| Paths | 2 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | public function current(): Event |
||
| 41 | { |
||
| 42 | $event = $this->iterator->current(); |
||
| 43 | |||
| 44 | if (!$event instanceof Event) { |
||
| 45 | throw new InvalidEventException(\sprintf( |
||
| 46 | 'Event collection only accepts %s, %s given', |
||
| 47 | Event::class, |
||
| 48 | \is_object($event) ? \get_class($event) : \gettype($event) |
||
| 49 | )); |
||
| 50 | } |
||
| 51 | |||
| 52 | return $event; |
||
| 53 | } |
||
| 54 | |||
| 89 |
This check compares the return type specified in the
@returnannotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.