@@ -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 | |
@@ -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 | { |
@@ -25,13 +25,13 @@ discard block |
||
| 25 | 25 | public $scheduled = ''; |
| 26 | 26 | |
| 27 | 27 | /** @var array */ |
| 28 | - public $payload = []; |
|
| 28 | + public $payload = [ ]; |
|
| 29 | 29 | |
| 30 | 30 | /** @var array */ |
| 31 | - public $iosData = []; |
|
| 31 | + public $iosData = [ ]; |
|
| 32 | 32 | |
| 33 | 33 | /** @var array */ |
| 34 | - public $androidData = []; |
|
| 34 | + public $androidData = [ ]; |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * @param array $data |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | */ |
| 130 | 130 | public function scheduled($date) |
| 131 | 131 | { |
| 132 | - if (! $date instanceof DateTime) { |
|
| 132 | + if (!$date instanceof DateTime) { |
|
| 133 | 133 | $date = new DateTime($date); |
| 134 | 134 | } |
| 135 | 135 | |
@@ -152,13 +152,13 @@ discard block |
||
| 152 | 152 | $key = snake_case(substr($method, 3)); |
| 153 | 153 | |
| 154 | 154 | if (in_array($key, $this->allowediOSOptions())) { |
| 155 | - $this->iosData[$key] = $args[0]; |
|
| 155 | + $this->iosData[ $key ] = $args[ 0 ]; |
|
| 156 | 156 | } |
| 157 | 157 | } elseif (substr($method, 0, 7) == 'android') { |
| 158 | 158 | $key = snake_case(substr($method, 7)); |
| 159 | 159 | |
| 160 | 160 | if (in_array($key, $this->allowedAndroidOptions())) { |
| 161 | - $this->androidData[$key] = $args[0]; |
|
| 161 | + $this->androidData[ $key ] = $args[ 0 ]; |
|
| 162 | 162 | } |
| 163 | 163 | } |
| 164 | 164 | |
@@ -229,28 +229,28 @@ discard block |
||
| 229 | 229 | ], |
| 230 | 230 | ]; |
| 231 | 231 | |
| 232 | - if (! empty($this->scheduled)) { |
|
| 233 | - $data['scheduled'] = $this->scheduled; |
|
| 232 | + if (!empty($this->scheduled)) { |
|
| 233 | + $data[ 'scheduled' ] = $this->scheduled; |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | - if (! empty($this->title)) { |
|
| 237 | - $data['notification']['title'] = $this->title; |
|
| 236 | + if (!empty($this->title)) { |
|
| 237 | + $data[ 'notification' ][ 'title' ] = $this->title; |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | - if (! empty($this->sound)) { |
|
| 241 | - $data['notification']['sound'] = $this->sound; |
|
| 240 | + if (!empty($this->sound)) { |
|
| 241 | + $data[ 'notification' ][ 'sound' ] = $this->sound; |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - if (! empty($this->iosData)) { |
|
| 245 | - $data['notification']['ios'] = $this->iosData; |
|
| 244 | + if (!empty($this->iosData)) { |
|
| 245 | + $data[ 'notification' ][ 'ios' ] = $this->iosData; |
|
| 246 | 246 | } |
| 247 | 247 | |
| 248 | - if (! empty($this->androidData)) { |
|
| 249 | - $data['notification']['android'] = $this->androidData; |
|
| 248 | + if (!empty($this->androidData)) { |
|
| 249 | + $data[ 'notification' ][ 'android' ] = $this->androidData; |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | - if (! empty($this->payload)) { |
|
| 253 | - $data['notification']['payload'] = $this->payload; |
|
| 252 | + if (!empty($this->payload)) { |
|
| 253 | + $data[ 'notification' ][ 'payload' ] = $this->payload; |
|
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | return $data; |