@@ -6,7 +6,7 @@ |
||
6 | 6 | * |
7 | 7 | */ |
8 | 8 | |
9 | -if (! function_exists('sendchamp')) { |
|
9 | +if (!function_exists('sendchamp')) { |
|
10 | 10 | function sendchamp() |
11 | 11 | { |
12 | 12 | return app()->make('laravel-sendchamp'); |
@@ -275,7 +275,7 @@ |
||
275 | 275 | * @return array |
276 | 276 | */ |
277 | 277 | public function sendOtp(string $channel, string $token_type, int $token_length, |
278 | - int $expiry_day, string $customer_email, string $customer_mobile_number, array $meta_data, string $sender) |
|
278 | + int $expiry_day, string $customer_email, string $customer_mobile_number, array $meta_data, string $sender) |
|
279 | 279 | { |
280 | 280 | if (! in_array($token_type, $this->tokenType)) { |
281 | 281 | throw new SendChampException('Invalid token type'); |
@@ -17,22 +17,22 @@ discard block |
||
17 | 17 | /** |
18 | 18 | * @var array |
19 | 19 | */ |
20 | - private $useCase = ['Transactional', 'Marketing', 'Transactional & Marketing']; |
|
20 | + private $useCase = [ 'Transactional', 'Marketing', 'Transactional & Marketing' ]; |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * @var array |
24 | 24 | */ |
25 | - private $channel = ['voice', 'sms', 'whatsapp', 'email']; |
|
25 | + private $channel = [ 'voice', 'sms', 'whatsapp', 'email' ]; |
|
26 | 26 | |
27 | 27 | /** |
28 | 28 | * @var array |
29 | 29 | */ |
30 | - private $tokenType = ['numeric', 'alphanumeric']; |
|
30 | + private $tokenType = [ 'numeric', 'alphanumeric' ]; |
|
31 | 31 | |
32 | 32 | /** |
33 | 33 | * @var array |
34 | 34 | */ |
35 | - private $smsRoute = ['non_dnd', 'dnd', 'international', 'PREMIUM_NG']; |
|
35 | + private $smsRoute = [ 'non_dnd', 'dnd', 'international', 'PREMIUM_NG' ]; |
|
36 | 36 | |
37 | 37 | /** |
38 | 38 | * @var string |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | * |
113 | 113 | * @throws SendChampException |
114 | 114 | */ |
115 | - private function setHttpResponse(string $url, $method = null, array $body = []) |
|
115 | + private function setHttpResponse(string $url, $method = null, array $body = [ ]) |
|
116 | 116 | { |
117 | 117 | if (is_null($method)) { |
118 | 118 | throw new SendChampException('Empty method not allowed'); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | $this->response = $this->client->{strtolower($method)}( |
122 | 122 | $this->baseUrl.$url, |
123 | - ['body' => json_encode($body)] |
|
123 | + [ 'body' => json_encode($body) ] |
|
124 | 124 | ); |
125 | 125 | |
126 | 126 | return $this; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | public function createSmsSender(string $sender_name, string $use_case, |
149 | 149 | string $sample_message) |
150 | 150 | { |
151 | - if (! in_array($use_case, $this->useCase)) { |
|
151 | + if (!in_array($use_case, $this->useCase)) { |
|
152 | 152 | throw new SendChampException('Invalid Use case'); |
153 | 153 | } |
154 | 154 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function sendSms(string $message, string $sender_name, array $numbers, string $route = '') |
182 | 182 | { |
183 | - if (! empty($route) && ! in_array($route, $this->smsRoute)) { |
|
183 | + if (!empty($route) && !in_array($route, $this->smsRoute)) { |
|
184 | 184 | throw new SendChampException('Invalid sms route'); |
185 | 185 | } |
186 | 186 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public function fetchSmsStatus(string $sms_id) |
205 | 205 | { |
206 | - return $this->setRequestOptions()->setHttpResponse('/sms/'.$sms_id.'/report', 'GET', [])->getResponse(); |
|
206 | + return $this->setRequestOptions()->setHttpResponse('/sms/'.$sms_id.'/report', 'GET', [ ])->getResponse(); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | /** |
@@ -277,11 +277,11 @@ discard block |
||
277 | 277 | public function sendOtp(string $channel, string $token_type, int $token_length, |
278 | 278 | int $expiry_day, string $customer_email, string $customer_mobile_number, array $meta_data, string $sender) |
279 | 279 | { |
280 | - if (! in_array($token_type, $this->tokenType)) { |
|
280 | + if (!in_array($token_type, $this->tokenType)) { |
|
281 | 281 | throw new SendChampException('Invalid token type'); |
282 | 282 | } |
283 | 283 | |
284 | - if (! in_array($channel, $this->channel)) { |
|
284 | + if (!in_array($channel, $this->channel)) { |
|
285 | 285 | throw new SendChampException('Invalid channel'); |
286 | 286 | } |
287 | 287 | |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | */ |
326 | 326 | public function getContactList() |
327 | 327 | { |
328 | - return $this->setRequestOptions()->setHttpResponse('/contacts', 'GET', [])->getResponse(); |
|
328 | + return $this->setRequestOptions()->setHttpResponse('/contacts', 'GET', [ ])->getResponse(); |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | /** |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | */ |
362 | 362 | public function deleteContact(string $id) |
363 | 363 | { |
364 | - return $this->setRequestOptions()->setHttpResponse('/contact/'.$id.'/delete', 'POST', [])->getResponse(); |
|
364 | + return $this->setRequestOptions()->setHttpResponse('/contact/'.$id.'/delete', 'POST', [ ])->getResponse(); |
|
365 | 365 | } |
366 | 366 | |
367 | 367 | /** |
@@ -371,6 +371,6 @@ discard block |
||
371 | 371 | */ |
372 | 372 | public function getWalletReport() |
373 | 373 | { |
374 | - return $this->setRequestOptions()->setHttpResponse('/report/wallet/list', 'GET', [])->getResponse(); |
|
374 | + return $this->setRequestOptions()->setHttpResponse('/report/wallet/list', 'GET', [ ])->getResponse(); |
|
375 | 375 | } |
376 | 376 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | public function register() |
27 | 27 | { |
28 | 28 | // |
29 | - $this->app->bind('laravel-sendchamp', function () { |
|
29 | + $this->app->bind('laravel-sendchamp', function() { |
|
30 | 30 | return new SendChamp; |
31 | 31 | }); |
32 | 32 | } |
@@ -50,6 +50,6 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function provides() |
52 | 52 | { |
53 | - return ['laravel-sendchamp']; |
|
53 | + return [ 'laravel-sendchamp' ]; |
|
54 | 54 | } |
55 | 55 | } |