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

Event::getData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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