This method seems to be duplicated in your project.
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.
Loading history...
21
{
22
6
if (is_null($this->eventEmitter)) {
23
6
return false;
24
}
25
26
if (!is_string($event) && !$event instanceof EventInterface) {
27
throw new \InvalidArgumentException('Event must be either be of type "string" or instance of League\Event\EventInterface');
28
}
29
30
$this->eventEmitter->emit($event);
31
32
return true;
33
}
34
35
/**
36
* @param EventInterface[]|string[] $events
37
* @throws \InvalidArgumentException
38
* @return bool true if all emitted, false otherwise
This method seems to be duplicated in your project.
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.
Loading history...
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');
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.