Completed
Pull Request — master (#79)
by
unknown
01:16
created

Notification::setImage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
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
     * @var string|null
24
     */
25
    protected $icon;
26
27
    /**
28
     * @return string|null
29
     */
30
    public function getTitle(): ?string
31
    {
32
        return $this->title;
33
    }
34
35
    /**
36
     * @param string|null $title
37
     * @return Notification
38
     */
39
    public function setTitle(?string $title): self
40
    {
41
        $this->title = $title;
42
43
        return $this;
44
    }
45
46
    /**
47
     * @return string|null
48
     */
49
    public function getBody(): ?string
50
    {
51
        return $this->body;
52
    }
53
54
    /**
55
     * @param string|null $body
56
     * @return Notification
57
     */
58
    public function setBody(?string $body): self
59
    {
60
        $this->body = $body;
61
62
        return $this;
63
    }
64
65
    /**
66
     * @return string|null
67
     */
68
    public function getImage(): ?string
69
    {
70
        return $this->image;
71
    }
72
73
    /**
74
     * @param string|null $image
75
     * @return Notification
76
     */
77
    public function setImage(?string $image): self
78
    {
79
        $this->image = $image;
80
81
        return $this;
82
    }
83
    
84
    /**
85
     * @return string|null
86
     */
87
    public function getIcon(): ?string
88
    {
89
        return $this->icon;
90
    }
91
92
    /**
93
     * @param string|null $image
0 ignored issues
show
Bug introduced by
There is no parameter named $image. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
94
     * @return Notification
95
     */
96
    public function setIcon(?string $icon): self
97
    {
98
        $this->icon = $icon;
99
100
        return $this;
101
    }
102
103
    /**
104
     * @return static
105
     */
106
    public static function create(): self
107
    {
108
        return new self;
109
    }
110
111
    /**
112
     * {@inheritdoc}
113
     */
114
    public function toArray(): array
115
    {
116
        return [
117
            'title' => $this->getTitle(),
118
            'body' => $this->getBody(),
119
            'image' => $this->getImage(),
120
            'icon' => $this->getIcon(),
121
        ];
122
    }
123
}
124