1 | <?php |
||
5 | class GcmMessage |
||
6 | { |
||
7 | /** |
||
8 | * Normal priority option. |
||
9 | * |
||
10 | * @var string |
||
11 | */ |
||
12 | const PRIORITY_NORMAL = 'normal'; |
||
13 | |||
14 | /** |
||
15 | * High priority option. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | const PRIORITY_HIGH = 'high'; |
||
20 | |||
21 | /** |
||
22 | * Default sound option. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | const DEFAULT_SOUND = 'default'; |
||
27 | |||
28 | /** |
||
29 | * The title of the notification. |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | public $title; |
||
34 | |||
35 | /** |
||
36 | * The icon of the notification. |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | public $icon; |
||
41 | |||
42 | /** |
||
43 | * The message of the notification. |
||
44 | * |
||
45 | * @var string |
||
46 | */ |
||
47 | public $message; |
||
48 | |||
49 | /** |
||
50 | * The priority of the notification. |
||
51 | * |
||
52 | * @var string |
||
53 | */ |
||
54 | public $priority = self::PRIORITY_NORMAL; |
||
55 | |||
56 | /** |
||
57 | * Notification sound. |
||
58 | * |
||
59 | * @var string |
||
60 | */ |
||
61 | public $sound = self::DEFAULT_SOUND; |
||
62 | |||
63 | /** |
||
64 | * Additional data of the notification. |
||
65 | * |
||
66 | * @var array |
||
67 | */ |
||
68 | public $data = []; |
||
69 | |||
70 | /** |
||
71 | * Additional notification data of the notification. |
||
72 | * |
||
73 | * @var array |
||
74 | */ |
||
75 | public $notification = []; |
||
76 | |||
77 | /** |
||
78 | * Create a new message instance. |
||
79 | * |
||
80 | * @param string|null $title |
||
81 | * @param string|null $message |
||
82 | * @param array $data |
||
83 | * @param string $priority |
||
84 | * @return static |
||
85 | */ |
||
86 | 1 | public static function create($title = null, $message = null, $data = [], $priority = self::PRIORITY_NORMAL, $sound = self::DEFAULT_SOUND, $notification = []) |
|
90 | |||
91 | /** |
||
92 | * Create a new message instance. |
||
93 | * |
||
94 | * @param string|null $title |
||
95 | * @param string|null $message |
||
96 | * @param array $data |
||
97 | * @param string $priority |
||
98 | * @param string $sound |
||
99 | */ |
||
100 | 11 | public function __construct($title = null, $message = null, $data = [], $priority = self::PRIORITY_NORMAL, $sound = self::DEFAULT_SOUND, $notification = []) |
|
109 | |||
110 | /** |
||
111 | * Set the title of the notification. |
||
112 | * |
||
113 | * @param string $title |
||
114 | * @return $this |
||
115 | */ |
||
116 | 1 | public function title($title) |
|
122 | |||
123 | /** |
||
124 | * Set the title of the notification. |
||
125 | * |
||
126 | * @param string $title |
||
|
|||
127 | * @return $this |
||
128 | */ |
||
129 | public function icon($icon) |
||
135 | |||
136 | /** |
||
137 | * Set the message of the notification. |
||
138 | * |
||
139 | * @param string $message |
||
140 | * @return $this |
||
141 | */ |
||
142 | 1 | public function message($message) |
|
148 | |||
149 | /** |
||
150 | * Set the priority of the notification. |
||
151 | * |
||
152 | * @param string $priority |
||
153 | * @return $this |
||
154 | */ |
||
155 | 1 | public function priority($priority) |
|
161 | |||
162 | /** |
||
163 | * Set the sound for notification. |
||
164 | * |
||
165 | * @param string $sound |
||
166 | * @return $this |
||
167 | */ |
||
168 | 1 | public function sound($sound) |
|
174 | |||
175 | /** |
||
176 | * Add data to the notification. |
||
177 | * |
||
178 | * @param string $key |
||
179 | * @param mixed $value |
||
180 | * @return $this |
||
181 | */ |
||
182 | 1 | public function data($key, $value) |
|
188 | |||
189 | /** |
||
190 | * Override the data of the notification. |
||
191 | * |
||
192 | * @param array $data |
||
193 | * @return $this |
||
194 | */ |
||
195 | public function setData($data) |
||
201 | |||
202 | /** |
||
203 | * Add notification data to the notification. |
||
204 | * |
||
205 | * @param string $key |
||
206 | * @param mixed $value |
||
207 | * @return $this |
||
208 | */ |
||
209 | 1 | public function notification($key, $value) |
|
215 | |||
216 | /** |
||
217 | * Override the notification data of the notification. |
||
218 | * |
||
219 | * @param array $notification |
||
220 | * @return $this |
||
221 | */ |
||
222 | public function setNotification($notification) |
||
228 | |||
229 | /** |
||
230 | * Add an action to the notification. |
||
231 | * |
||
232 | * @param string $action |
||
233 | * @param mixed $params |
||
234 | * @return $this |
||
235 | */ |
||
236 | public function action($action, $params = null) |
||
243 | } |
||
244 |
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 methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.