@@ -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 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $ionicPushData = array_merge( |
| 49 | 49 | $message->toArray(), |
| 50 | - [$message->getSendToType() => $routing->first()] |
|
| 50 | + [ $message->getSendToType() => $routing->first() ] |
|
| 51 | 51 | ); |
| 52 | 52 | |
| 53 | 53 | $response = $this->client->post(self::API_ENDPOINT, [ |
@@ -32,7 +32,6 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | - * @param array $data |
|
| 36 | 35 | * |
| 37 | 36 | * @return static |
| 38 | 37 | */ |
@@ -67,7 +66,6 @@ discard block |
||
| 67 | 66 | /** |
| 68 | 67 | * Set the method of targeting users - tokens (default), user_ids, or emails. |
| 69 | 68 | * |
| 70 | - * @param string $profile |
|
| 71 | 69 | * |
| 72 | 70 | * @return $this |
| 73 | 71 | */ |
@@ -110,7 +108,7 @@ discard block |
||
| 110 | 108 | * @param string $method |
| 111 | 109 | * @param array $args |
| 112 | 110 | * |
| 113 | - * @return object |
|
| 111 | + * @return IonicPushMessage |
|
| 114 | 112 | */ |
| 115 | 113 | public function __call($method, $args) |
| 116 | 114 | { |
@@ -20,13 +20,13 @@ discard block |
||
| 20 | 20 | protected $sound = ''; |
| 21 | 21 | |
| 22 | 22 | /** @var array */ |
| 23 | - protected $payload = []; |
|
| 23 | + protected $payload = [ ]; |
|
| 24 | 24 | |
| 25 | 25 | /** @var array */ |
| 26 | - protected $iosData = []; |
|
| 26 | + protected $iosData = [ ]; |
|
| 27 | 27 | |
| 28 | 28 | /** @var array */ |
| 29 | - protected $androidData = []; |
|
| 29 | + protected $androidData = [ ]; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * @param array $data |
@@ -117,11 +117,11 @@ discard block |
||
| 117 | 117 | if (substr($method, 0, 3) == 'ios') { |
| 118 | 118 | $key = snake_case(substr($method, 3)); |
| 119 | 119 | |
| 120 | - $this->iosData[$key] = $args[0]; |
|
| 120 | + $this->iosData[ $key ] = $args[ 0 ]; |
|
| 121 | 121 | } elseif (substr($method, 0, 7) == 'android') { |
| 122 | 122 | $key = snake_case(substr($method, 7)); |
| 123 | 123 | |
| 124 | - $this->androidData[$key] = $args[0]; |
|
| 124 | + $this->androidData[ $key ] = $args[ 0 ]; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | return $this; |
@@ -151,16 +151,16 @@ discard block |
||
| 151 | 151 | ], |
| 152 | 152 | ]; |
| 153 | 153 | |
| 154 | - if (! empty($this->iosData)) { |
|
| 155 | - $data['notification']['ios'] = $this->iosData; |
|
| 154 | + if (!empty($this->iosData)) { |
|
| 155 | + $data[ 'notification' ][ 'ios' ] = $this->iosData; |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | - if (! empty($this->androidData)) { |
|
| 159 | - $data['notification']['android'] = $this->androidData; |
|
| 158 | + if (!empty($this->androidData)) { |
|
| 159 | + $data[ 'notification' ][ 'android' ] = $this->androidData; |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | - if (! empty($this->payload)) { |
|
| 163 | - $data['notification']['payload'] = $this->payload; |
|
| 162 | + if (!empty($this->payload)) { |
|
| 163 | + $data[ 'notification' ][ 'payload' ] = $this->payload; |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | return $data; |