Completed
Push — master ( 0d4684...fff311 )
by Chris
01:24
created

Notification::getTitle()   A

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
namespace NotificationChannels\Fcm\Resources;
4
5
class Notification implements FcmResource
6
{
7
    /**
8
     * @var string|null
9
     */
10
    protected $title;
11
12
    /**
13
     * @var string|null
14
     */
15
    protected $body;
16
17
    /**
18
     * @var string|null
19
     */
20
    protected $image;
21
22
    /**
23
     * @return string|null
24
     */
25
    public function getTitle(): ?string
26
    {
27
        return $this->title;
28
    }
29
30
    /**
31
     * @param string|null $title
32
     * @return Notification
33
     */
34
    public function setTitle(?string $title): self
35
    {
36
        $this->title = $title;
37
38
        return $this;
39
    }
40
41
    /**
42
     * @return string|null
43
     */
44
    public function getBody(): ?string
45
    {
46
        return $this->body;
47
    }
48
49
    /**
50
     * @param string|null $body
51
     * @return Notification
52
     */
53
    public function setBody(?string $body): self
54
    {
55
        $this->body = $body;
56
57
        return $this;
58
    }
59
60
    /**
61
     * @return string|null
62
     */
63
    public function getImage(): ?string
64
    {
65
        return $this->image;
66
    }
67
68
    /**
69
     * @param string|null $image
70
     * @return Notification
71
     */
72
    public function setImage(?string $image): self
73
    {
74
        $this->image = $image;
75
76
        return $this;
77
    }
78
79
    /**
80
     * @return static
81
     */
82
    public static function create(): self
83
    {
84
        return new self;
85
    }
86
87
    /**
88
     * {@inheritdoc}
89
     */
90
    public function toArray(): array
91
    {
92
        return [
93
            'title' => $this->getTitle(),
94
            'body' => $this->getBody(),
95
            'image' => $this->getImage(),
96
        ];
97
    }
98
}
99