GenericEvent::subject()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * @author stev leibelt <[email protected]>
4
 * @since 2016-08-20
5
 */
6
namespace Net\Bazzline\Component\Event;
7
8
use DateTime;
9
10
class GenericEvent implements EventInterface
11
{
12
    /** @var DateTime */
13
    private $emittedAt;
14
15
    /** @var string */
16
    private $name;
17
18
    /** @var string */
19
    private $source;
20
21
    /** @var array|object */
22
    private $subject;
23
24
    /**
25
     * Event constructor.
26
     *
27
     * @param DateTime $emittedAt
28
     * @param string $name
29
     * @param string $source
30
     * @param array|object $subject
31
     */
32
    public function __construct(DateTime $emittedAt, $name, $source, $subject)
33
    {
34
        $this->emittedAt    = $emittedAt;
35
        $this->name         = $name;
36
        $this->source       = $source;
37
        $this->subject      = $subject;
38
    }
39
40
    /** @return DateTime */
41
    public function emittedAt()
42
    {
43
        return $this->emittedAt;
44
    }
45
46
    /** @return string */
47
    public function name()
48
    {
49
        return $this->name;
50
    }
51
52
    /** @return string */
53
    public function source()
54
    {
55
        return $this->source;
56
    }
57
58
    /** @return array|object */
59
    public function subject()
60
    {
61
        return $this->subject;
62
    }
63
}
64