TestDispatcher   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 20
rs 10
c 0
b 0
f 0

3 Methods

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

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...
12
    
13
    public function __construct()
14
    {
15
        $this->events = array();
16
    }
17
    
18
    public function dispatch(Event $event)
19
    {
20
        $this->events[] = $event;
21
    }
22
    
23
    public function getEvents()
24
    {
25
        return $this->events;
26
    }
27
}