EventDispatcher   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 15
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A dispatch() 0 4 1
1
<?php
2
3
namespace Solidifier\Dispatchers;
4
5
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
6
use Solidifier\Dispatcher;
7
use Solidifier\Event;
8
9
class EventDispatcher implements Dispatcher
10
{
11
    private
12
        $dispatcher;
0 ignored issues
show
Coding Style introduced by
The visibility should be declared for property $dispatcher.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
13
    
14
    public function __construct(EventDispatcherInterface $dispatcher)
15
    {
16
        $this->dispatcher = $dispatcher;
17
    }
18
    
19
    public function dispatch(Event $event)
20
    {
21
        $this->dispatcher->dispatch($event->getEventName(), $event);
22
    }
23
}