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

Notification   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 58
c 0
b 0
f 0
wmc 6
lcom 0
cbo 0
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getEvent() 0 4 1
A setEvent() 0 4 1
A getTrackers() 0 4 1
A setTrackers() 0 4 1
A fromArray() 0 4 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
use Fnayou\InstapushPHP\Model\FromArrayInterface;
14
15
/**
16
 * Class Notification.
17
 */
18
class Notification implements FromArrayInterface
19
{
20
    /** @var string */
21
    private $event;
22
23
    /** @var array */
24
    private $trackers;
25
26
    /**
27
     * @param string $event
28
     * @param array  $trackers
29
     */
30
    public function __construct(string $event, array $trackers)
31
    {
32
        $this->event = $event;
33
        $this->trackers = $trackers;
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function getEvent()
40
    {
41
        return $this->event;
42
    }
43
44
    /**
45
     * @param string $event
46
     */
47
    public function setEvent(string $event)
48
    {
49
        $this->event = $event;
50
    }
51
52
    /**
53
     * @return array
54
     */
55
    public function getTrackers()
56
    {
57
        return $this->trackers;
58
    }
59
60
    /**
61
     * @param array $trackers
62
     */
63
    public function setTrackers(array $trackers)
64
    {
65
        $this->trackers = $trackers;
66
    }
67
68
    /**
69
     * {@inheritdoc}
70
     */
71
    public static function fromArray(array $data)
72
    {
73
        return new static($data['event'], $data['trackers']);
74
    }
75
}
76