Completed
Push — master ( 611a4d...0d4705 )
by Artem
11:18 queued 04:23
created

AbstractMobileNotificationPayload   A

Complexity

Total Complexity 12

Size/Duplication

Total Lines 125
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Importance

Changes 0
Metric Value
wmc 12
lcom 2
cbo 1
dl 0
loc 125
rs 10
c 0
b 0
f 0
1
<?php
2
/*
3
 * This file is part of the FirebaseCloudMessagingBundle.
4
 *
5
 * (c) Artem Henvald <[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
declare(strict_types=1);
12
13
namespace Fresh\FirebaseCloudMessagingBundle\Message\Part\Payload\Notification;
14
15
/**
16
 * AbstractMobileNotificationPayload.
17
 *
18
 * @author Artem Henvald <[email protected]>
19
 */
20
abstract class AbstractMobileNotificationPayload extends AbstractCommonNotificationPayload
21
{
22
    private ?string $sound = null;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected '?', expecting T_FUNCTION or T_CONST
Loading history...
23
24
    private ?string $bodyLocKey = null;
25
26
    /** @var string[]|null */
27
    private ?array $bodyLocArgs = null;
28
29
    private ?string $titleLocKey = null;
30
31
    /** @var string[]|null */
32
    private ?array $titleLocArgs = null;
33
34
    /**
35
     * @param string $sound
36
     *
37
     * @return $this
38
     */
39
    public function setSound(string $sound): self
40
    {
41
        $this->sound = $sound;
42
43
        return $this;
44
    }
45
46
    /**
47
     * @return string|null
48
     */
49
    public function getSound(): ?string
50
    {
51
        return $this->sound;
52
    }
53
54
    /**
55
     * @param string $bodyLocKey
56
     *
57
     * @return $this
58
     */
59
    public function setBodyLocKey(string $bodyLocKey): self
60
    {
61
        $this->bodyLocKey = $bodyLocKey;
62
63
        return $this;
64
    }
65
66
    /**
67
     * @return string|null
68
     */
69
    public function getBodyLocKey(): ?string
70
    {
71
        return $this->bodyLocKey;
72
    }
73
74
    /**
75
     * @param string[] $bodyLocArgs
76
     *
77
     * @return $this
78
     */
79
    public function setBodyLocArgs(array $bodyLocArgs): self
80
    {
81
        foreach ($bodyLocArgs as &$bodyLocArg) {
82
            $bodyLocArg = (string) $bodyLocArg;
83
        }
84
        unset($bodyLocArg);
85
        $this->bodyLocArgs = $bodyLocArgs;
86
87
        return $this;
88
    }
89
90
    /**
91
     * @return string[]|null
92
     */
93
    public function getBodyLocArgs(): ?array
94
    {
95
        return $this->bodyLocArgs;
96
    }
97
98
    /**
99
     * @param string $titleLocKey
100
     *
101
     * @return $this
102
     */
103
    public function setTitleLocKey(string $titleLocKey): self
104
    {
105
        $this->titleLocKey = $titleLocKey;
106
107
        return $this;
108
    }
109
110
    /**
111
     * @return string|null
112
     */
113
    public function getTitleLocKey(): ?string
114
    {
115
        return $this->titleLocKey;
116
    }
117
118
    /**
119
     * @param string[] $titleLocArgs
120
     *
121
     * @return $this
122
     */
123
    public function setTitleLocArgs(array $titleLocArgs): self
124
    {
125
        foreach ($titleLocArgs as &$titleLocArg) {
126
            $titleLocArg = (string) $titleLocArg;
127
        }
128
        unset($titleLocArg);
129
        $this->titleLocArgs = $titleLocArgs;
130
131
        return $this;
132
    }
133
134
    /**
135
     * @return string[]|null
136
     */
137
    public function getTitleLocArgs(): ?array
138
    {
139
        return $this->titleLocArgs;
140
    }
141
}
142