Completed
Push — master ( 9abbc7...a687e5 )
by Fabrizio
03:03
created

NotifynderEvent::getCategory()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Fenos\Notifynder\Handler;
4
5
use Fenos\Notifynder\Contracts\NotifyListener;
6
7
/**
8
 * Class NotifynderEvent.
9
 */
10
class NotifynderEvent implements NotifyListener
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $event;
16
17
    /**
18
     * @var array
19
     */
20
    protected $values;
21
22
    /**
23
     * @var string
24
     */
25
    protected $category;
26
27
    /**
28
     * @param       $event
29
     * @param       $category
30
     * @param array $values
31
     */
32
    public function __construct($event, $category = null, array $values = [])
33
    {
34
        $this->event = $event;
35
        $this->values = $values;
36
        $this->category = $category;
37
    }
38
39
    /**
40
     * @return mixed
41
     */
42
    public function getEvent()
43
    {
44
        return $this->event;
45
    }
46
47
    /**
48
     * Get a value from the given
49
     * values.
50
     *
51
     * @param $name
52
     * @return mixed
53
     */
54
    public function get($name)
55
    {
56
        if (array_key_exists($name, $this->values)) {
57
            return $this->values[$name];
58
        }
59
    }
60
61
    /**
62
     * @return string
63
     */
64
    public function getCategory()
65
    {
66
        return $this->category;
67
    }
68
69
    /**
70
     * @param $name
71
     * @return mixed
72
     */
73
    public function __get($name)
74
    {
75
        return $this->get($name);
76
    }
77
78
    /**
79
     * @return NotifynderEvent
80
     */
81
    public function getNotifynderEvent()
82
    {
83
        return $this;
84
    }
85
}
86