1 | <?php |
||
8 | class ApnMessage |
||
9 | { |
||
10 | /** |
||
11 | * The title of the notification. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | public $title; |
||
16 | |||
17 | /** |
||
18 | * The body of the notification. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | public $body; |
||
23 | |||
24 | /** |
||
25 | * The badge of the notification. |
||
26 | * |
||
27 | * @var int |
||
28 | */ |
||
29 | public $badge; |
||
30 | |||
31 | /** |
||
32 | * The sound for the notification. |
||
33 | * |
||
34 | * @var string|null |
||
35 | */ |
||
36 | public $sound; |
||
37 | |||
38 | /** |
||
39 | * The category for action button. |
||
40 | * |
||
41 | * @var string|null |
||
42 | * */ |
||
43 | public $category; |
||
44 | |||
45 | /** |
||
46 | * Value indicating incoming resource in the notification. |
||
47 | * |
||
48 | * @var int|null |
||
49 | */ |
||
50 | public $contentAvailable = null; |
||
51 | |||
52 | /** |
||
53 | * Additional data of the notification. |
||
54 | * |
||
55 | * @var array |
||
56 | */ |
||
57 | public $custom = []; |
||
58 | |||
59 | /** |
||
60 | * Value indicating when the message will expire. |
||
61 | * |
||
62 | * @var \string |
||
63 | */ |
||
64 | public $pushType = null; |
||
65 | |||
66 | /** |
||
67 | * The expiration time of the notification. |
||
68 | * |
||
69 | * @var \DateTime|null |
||
70 | */ |
||
71 | public $expiresAt = null; |
||
72 | |||
73 | /** |
||
74 | * Message specific client. |
||
75 | * |
||
76 | * @var \Pushok\Client|null |
||
77 | */ |
||
78 | public $client = null; |
||
79 | |||
80 | /** |
||
81 | * The notification service app extension flag. |
||
82 | * |
||
83 | * @var int|null |
||
84 | */ |
||
85 | public $mutableContent = null; |
||
86 | |||
87 | /** |
||
88 | * @param string|null $title |
||
89 | * @param string|null $body |
||
90 | * @param array $custom |
||
91 | * @param null|int $badge |
||
92 | * |
||
93 | * @return static |
||
94 | */ |
||
95 | 1 | public static function create($title = null, $body = null, $custom = [], $badge = null) |
|
99 | |||
100 | /** |
||
101 | * @param string|null $title |
||
102 | * @param string|null $body |
||
103 | * @param array $custom |
||
104 | * @param null|int $badge |
||
105 | */ |
||
106 | 16 | public function __construct($title = null, $body = null, $custom = [], $badge = null) |
|
113 | |||
114 | /** |
||
115 | * Set the alert title of the notification. |
||
116 | * |
||
117 | * @param string $title |
||
118 | * |
||
119 | * @return $this |
||
120 | */ |
||
121 | 1 | public function title($title) |
|
127 | |||
128 | /** |
||
129 | * Set the alert message of the notification. |
||
130 | * |
||
131 | * @param string $body |
||
132 | * |
||
133 | * @return $this |
||
134 | */ |
||
135 | 1 | public function body($body) |
|
141 | |||
142 | /** |
||
143 | * Set the badge of the notification. |
||
144 | * |
||
145 | * @param int $badge |
||
146 | * |
||
147 | * @return $this |
||
148 | */ |
||
149 | 1 | public function badge($badge) |
|
155 | |||
156 | /** |
||
157 | * Set the sound for the notification. |
||
158 | * |
||
159 | * @param string|null $sound |
||
160 | * |
||
161 | * @return $this |
||
162 | */ |
||
163 | 2 | public function sound($sound = 'default') |
|
169 | |||
170 | /** |
||
171 | * Set category for this notification. |
||
172 | * |
||
173 | * @param string|null $category |
||
174 | * |
||
175 | * @return $this |
||
176 | * */ |
||
177 | 1 | public function category($category) |
|
183 | |||
184 | /** |
||
185 | * Set content available value for this notification. |
||
186 | * |
||
187 | * @param int $value |
||
188 | * |
||
189 | * @return $this |
||
190 | */ |
||
191 | 1 | public function contentAvailable($value = 1) |
|
197 | |||
198 | /** |
||
199 | * Set the push type for this notification. |
||
200 | * |
||
201 | * @param string $pushType |
||
202 | * |
||
203 | * @return $this |
||
204 | */ |
||
205 | 1 | public function pushType(string $pushType) |
|
211 | |||
212 | /** |
||
213 | * Set the expiration time for the message. |
||
214 | * |
||
215 | * @param \DateTime $expiresAt |
||
216 | * |
||
217 | * @return $this |
||
218 | */ |
||
219 | 1 | public function expiresAt(DateTime $expiresAt) |
|
225 | |||
226 | /** |
||
227 | * Add custom data to the notification. |
||
228 | * |
||
229 | * @param string $key |
||
230 | * @param mixed $value |
||
231 | * |
||
232 | * @return $this |
||
233 | */ |
||
234 | 2 | public function custom($key, $value) |
|
240 | |||
241 | /** |
||
242 | * Override the data of the notification. |
||
243 | * |
||
244 | * @param array $custom |
||
245 | * |
||
246 | * @return $this |
||
247 | */ |
||
248 | 1 | public function setCustom($custom) |
|
254 | |||
255 | /** |
||
256 | * Add an action to the notification. |
||
257 | * |
||
258 | * @param string $action |
||
259 | * @param mixed $params |
||
260 | * |
||
261 | * @return $this |
||
262 | */ |
||
263 | 1 | public function action($action, $params = null) |
|
270 | |||
271 | /** |
||
272 | * Set message specific client. |
||
273 | * |
||
274 | * @param \Pushok\Client |
||
275 | * @return $this |
||
276 | */ |
||
277 | 1 | public function via(Client $client) |
|
283 | |||
284 | /** |
||
285 | * Set mutable content value for this notification. |
||
286 | * |
||
287 | * @param int $value |
||
288 | * |
||
289 | * @return $this |
||
290 | */ |
||
291 | 1 | public function mutableContent($value = 1) |
|
297 | } |
||
298 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..