Conditions | 5 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 16 |
Ratio | 100 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
40 | View Code Duplication | private function emitBatchOfEvents(array $events) |
|
41 | { |
||
42 | if (is_null($this->eventEmitter)) { |
||
43 | return false; |
||
44 | } |
||
45 | |||
46 | foreach ($events as $e) { |
||
47 | if (!is_string($e) && !$e instanceof EventInterface) { |
||
48 | throw new \InvalidArgumentException('Event must be either be of type "string" or instance of League\Event\EventInterface'); |
||
49 | } |
||
50 | } |
||
51 | |||
52 | $this->emitBatchOfEvents($events); |
||
53 | |||
54 | return true; |
||
55 | } |
||
56 | |||
73 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.