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

Event::getMessage()   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 0
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
 * Model Event.
15
 */
16
class Event implements FromArrayInterface
17
{
18
    /** @var string */
19
    private $title;
20
21
    /** @var string */
22
    private $message;
23
24
    /** @var array */
25
    private $trackers;
26
27
    /**
28
     * @param string $title
29
     * @param string $message
30
     * @param array  $trackers
31
     */
32
    public function __construct(string $title, string $message, array $trackers)
33
    {
34
        $this->title = $title;
35
        $this->trackers = $trackers;
36
        $this->message = $message;
37
    }
38
39
    /**
40
     * @return string
41
     */
42
    public function getTitle()
43
    {
44
        return $this->title;
45
    }
46
47
    /**
48
     * @param string $title
49
     */
50
    public function setTitle(string $title)
51
    {
52
        $this->title = $title;
53
    }
54
55
    /**
56
     * @return string
57
     */
58
    public function getMessage()
59
    {
60
        return $this->message;
61
    }
62
63
    /**
64
     * @param string $message
65
     */
66
    public function setMessage(string $message)
67
    {
68
        $this->message = $message;
69
    }
70
71
    /**
72
     * @return array
73
     */
74
    public function getTrackers()
75
    {
76
        return $this->trackers;
77
    }
78
79
    /**
80
     * @param array $trackers
81
     */
82
    public function setTrackers(array $trackers)
83
    {
84
        $this->trackers = $trackers;
85
    }
86
87
    /**
88
     * {@inheritdoc}
89
     */
90
    public static function fromArray(array $data)
91
    {
92
        return new static($data['title'], $data['message'], $data['trackers']);
93
    }
94
}
95