WebpushFcmOptions::getLink()   A
last analyzed

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 WebpushFcmOptions implements FcmResource
6
{
7
    /**
8
     * @var string|null
9
     */
10
    protected $link;
11
12
    /**
13
     * @var string|null
14
     */
15
    protected $analyticsLabel;
16
17
    /**
18
     * @return static
19
     */
20
    public static function create(): self
21
    {
22
        return new self;
23
    }
24
25
    /**
26
     * @return string|null
27
     */
28
    public function getLink(): ?string
29
    {
30
        return $this->link;
31
    }
32
33
    /**
34
     * @param string|null $link
35
     * @return WebpushFcmOptions
36
     */
37
    public function setLink(?string $link): self
38
    {
39
        $this->link = $link;
40
41
        return $this;
42
    }
43
44
    /**
45
     * @return string|null
46
     */
47
    public function getAnalyticsLabel(): ?string
48
    {
49
        return $this->analyticsLabel;
50
    }
51
52
    /**
53
     * @param string|null $analyticsLabel
54
     * @return WebpushFcmOptions
55
     */
56
    public function setAnalyticsLabel(?string $analyticsLabel): self
57
    {
58
        $this->analyticsLabel = $analyticsLabel;
59
60
        return $this;
61
    }
62
63
    /**
64
     * {@inheritdoc}
65
     */
66
    public function toArray(): array
67
    {
68
        return [
69
            'link' => $this->getLink(),
70
            'analytics_label' => $this->getAnalyticsLabel(),
71
        ];
72
    }
73
}
74