Completed
Pull Request — master (#3)
by Aymen
02:00
created

Notification::setEvent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * This file is part of the fnayou/instapush-php project.
4
 *
5
 * Copyright (c) 2017. Aymen FNAYOU <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Fnayou\InstapushPHP\Model;
12
13
/**
14
 * Class Notification.
15
 */
16
class Notification implements FromArrayInterface
17
{
18
    /** @var string */
19
    private $event;
20
21
    /** @var array */
22
    private $trackers;
23
24
    /**
25
     * @param string $event
26
     * @param array  $trackers
27
     */
28
    public function __construct(string $event, array $trackers)
29
    {
30
        $this->event = $event;
31
        $this->trackers = $trackers;
32
    }
33
34
    /**
35
     * @return string
36
     */
37
    public function getEvent()
38
    {
39
        return $this->event;
40
    }
41
42
    /**
43
     * @param string $event
44
     */
45
    public function setEvent(string $event)
46
    {
47
        $this->event = $event;
48
    }
49
50
    /**
51
     * @return array
52
     */
53
    public function getTrackers()
54
    {
55
        return $this->trackers;
56
    }
57
58
    /**
59
     * @param array $trackers
60
     */
61
    public function setTrackers(array $trackers)
62
    {
63
        $this->trackers = $trackers;
64
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69
    public static function fromArray(array $data)
70
    {
71
        return new static($data['event'], $data['trackers']);
72
    }
73
}
74