Completed
Push — master ( 45f6ae...0ec5e3 )
by Dmitriy
04:18
created

Event   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 53
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getName() 0 4 1
A getEntity() 0 4 1
A getData() 0 4 1
1
<?php
2
3
namespace T4webDomain;
4
5
use T4webDomainInterface\EntityInterface;
6
use T4webDomainInterface\EventInterface;
7
8
class Event implements EventInterface {
9
10
    /**
11
     * @var string
12
     */
13
    protected $name;
14
15
    /**
16
     * @var EntityInterface
17
     */
18
    protected $entity;
19
20
    /**
21
     * @var array
22
     */
23
    protected $data = [];
24
25
    /**
26
     * Event constructor.
27
     * @param string $name
28
     * @param EntityInterface $entity
29
     * @param array $data
30
     */
31
    public function __construct($name, EntityInterface $entity, array $data = []) {
32
        $this->name = $name;
33
        $this->entity = $entity;
34
        $this->data = $data;
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getName()
41
    {
42
        return $this->name;
43
    }
44
45
    /**
46
     * @return EntityInterface
47
     */
48
    public function getEntity()
49
    {
50
        return $this->entity;
51
    }
52
53
    /**
54
     * @return array
55
     */
56
    public function getData()
57
    {
58
        return $this->data;
59
    }
60
}
61