@@ -3,8 +3,8 @@ |
||
3 | 3 | namespace NotificationChannels\IonicPushNotifications; |
4 | 4 | |
5 | 5 | use GuzzleHttp\Client; |
6 | -use NotificationChannels\IonicPushNotifications\Exceptions\CouldNotSendNotification; |
|
7 | 6 | use Illuminate\Notifications\Notification; |
7 | +use NotificationChannels\IonicPushNotifications\Exceptions\CouldNotSendNotification; |
|
8 | 8 | use NotificationChannels\IonicPushNotifications\Exceptions\InvalidConfiguration; |
9 | 9 | |
10 | 10 | class IonicPushChannel |
@@ -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 |
@@ -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; |