@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function send($notifiable, Notification $notification) |
35 | 35 | { |
36 | - if (! $routing = collect($notifiable->routeNotificationFor('IonicPush'))) { |
|
36 | + if (!$routing = collect($notifiable->routeNotificationFor('IonicPush'))) { |
|
37 | 37 | return; |
38 | 38 | } |
39 | 39 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $message = $notification->toIonicPush($notifiable); |
47 | 47 | |
48 | 48 | $ionicPushData = array_merge( |
49 | - [$message->getSendToType() => $routing->first()], |
|
49 | + [ $message->getSendToType() => $routing->first() ], |
|
50 | 50 | $message->toArray() |
51 | 51 | ); |
52 | 52 |
@@ -29,7 +29,6 @@ discard block |
||
29 | 29 | public $androidData = []; |
30 | 30 | |
31 | 31 | /** |
32 | - * @param array $data |
|
33 | 32 | * |
34 | 33 | * @return static |
35 | 34 | */ |
@@ -49,7 +48,6 @@ discard block |
||
49 | 48 | /** |
50 | 49 | * Set the method of targeting users - tokens (default), user_ids, or emails. |
51 | 50 | * |
52 | - * @param string $profile |
|
53 | 51 | * |
54 | 52 | * @return $this |
55 | 53 | */ |
@@ -122,7 +120,7 @@ discard block |
||
122 | 120 | * @param string $method |
123 | 121 | * @param array $args |
124 | 122 | * |
125 | - * @return object |
|
123 | + * @return IonicPushMessage |
|
126 | 124 | */ |
127 | 125 | public function __call($method, $args) |
128 | 126 | { |
@@ -156,7 +154,7 @@ discard block |
||
156 | 154 | /** |
157 | 155 | * List of allowed Android options. |
158 | 156 | * |
159 | - * @return array |
|
157 | + * @return string[] |
|
160 | 158 | */ |
161 | 159 | public function allowedAndroidOptions() |
162 | 160 | { |
@@ -179,7 +177,7 @@ discard block |
||
179 | 177 | /** |
180 | 178 | * List of allowed iOS options. |
181 | 179 | * |
182 | - * @return array |
|
180 | + * @return string[] |
|
183 | 181 | */ |
184 | 182 | public function allowediOSOptions() |
185 | 183 | { |
@@ -20,13 +20,13 @@ discard block |
||
20 | 20 | public $sound = ''; |
21 | 21 | |
22 | 22 | /** @var array */ |
23 | - public $payload = []; |
|
23 | + public $payload = [ ]; |
|
24 | 24 | |
25 | 25 | /** @var array */ |
26 | - public $iosData = []; |
|
26 | + public $iosData = [ ]; |
|
27 | 27 | |
28 | 28 | /** @var array */ |
29 | - public $androidData = []; |
|
29 | + public $androidData = [ ]; |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * @param array $data |
@@ -129,14 +129,14 @@ discard block |
||
129 | 129 | if (substr($method, 0, 3) == 'ios') { |
130 | 130 | $key = snake_case(substr($method, 3)); |
131 | 131 | |
132 | - if(in_array($key, $this->allowediOSOptions())) { |
|
133 | - $this->iosData[$key] = $args[0]; |
|
132 | + if (in_array($key, $this->allowediOSOptions())) { |
|
133 | + $this->iosData[ $key ] = $args[ 0 ]; |
|
134 | 134 | } |
135 | 135 | } elseif (substr($method, 0, 7) == 'android') { |
136 | 136 | $key = snake_case(substr($method, 7)); |
137 | 137 | |
138 | - if(in_array($key, $this->allowedAndroidOptions())) { |
|
139 | - $this->androidData[$key] = $args[0]; |
|
138 | + if (in_array($key, $this->allowedAndroidOptions())) { |
|
139 | + $this->androidData[ $key ] = $args[ 0 ]; |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 | |
@@ -207,24 +207,24 @@ discard block |
||
207 | 207 | ], |
208 | 208 | ]; |
209 | 209 | |
210 | - if (! empty($this->title)) { |
|
211 | - $data['notification']['title'] = $this->title; |
|
210 | + if (!empty($this->title)) { |
|
211 | + $data[ 'notification' ][ 'title' ] = $this->title; |
|
212 | 212 | } |
213 | 213 | |
214 | - if (! empty($this->sound)) { |
|
215 | - $data['notification']['sound'] = $this->sound; |
|
214 | + if (!empty($this->sound)) { |
|
215 | + $data[ 'notification' ][ 'sound' ] = $this->sound; |
|
216 | 216 | } |
217 | 217 | |
218 | - if (! empty($this->iosData)) { |
|
219 | - $data['notification']['ios'] = $this->iosData; |
|
218 | + if (!empty($this->iosData)) { |
|
219 | + $data[ 'notification' ][ 'ios' ] = $this->iosData; |
|
220 | 220 | } |
221 | 221 | |
222 | - if (! empty($this->androidData)) { |
|
223 | - $data['notification']['android'] = $this->androidData; |
|
222 | + if (!empty($this->androidData)) { |
|
223 | + $data[ 'notification' ][ 'android' ] = $this->androidData; |
|
224 | 224 | } |
225 | 225 | |
226 | - if (! empty($this->payload)) { |
|
227 | - $data['notification']['payload'] = $this->payload; |
|
226 | + if (!empty($this->payload)) { |
|
227 | + $data[ 'notification' ][ 'payload' ] = $this->payload; |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | return $data; |