DispatchEventTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 14
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A dispatchEvent() 0 7 2
1
<?php
2
3
namespace Vox\Webservice\Event;
4
5
use Vox\Webservice\EventDispatcherInterface;
6
7
trait DispatchEventTrait
8
{
9
    /**
10
     * @var EventDispatcherInterface
11
     */
12
    private $eventDispatcher;
13
    
14 18
    private function dispatchEvent(string $event, EventInterface $context = null)
15
    {
16 18
        if (!$this->eventDispatcher) {
17 16
            return;
18
        }
19
        
20 2
        $this->eventDispatcher->dispatch($event, $context);
21 2
    }
22
}
23