@@ -18,13 +18,13 @@ |
||
18 | 18 | * Configurations that needs to be done by user. |
19 | 19 | */ |
20 | 20 | $this->publishes([ |
21 | - __DIR__.'/../Config/sms.php' => config_path('sms.php'), |
|
21 | + __DIR__ . '/../Config/sms.php' => config_path('sms.php'), |
|
22 | 22 | ], 'config'); |
23 | 23 | |
24 | 24 | /** |
25 | 25 | * Bind to service container. |
26 | 26 | */ |
27 | - $this->app->singleton('tzsk-sms', function () { |
|
27 | + $this->app->singleton('tzsk-sms', function() { |
|
28 | 28 | return new SmsManager(); |
29 | 29 | }); |
30 | 30 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | 'hash' => 'Your Hash', |
29 | 29 | 'sender' => 'Sender Name', |
30 | 30 | ], |
31 | - 'twilio' => [ // Install: composer require twilio/sdk |
|
31 | + 'twilio' => [// Install: composer require twilio/sdk |
|
32 | 32 | 'sid' => 'Your SID', |
33 | 33 | 'token' => 'Your Token', |
34 | 34 | 'from' => 'Your Default From Number', |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | 'password' => 'Your Password', |
40 | 40 | 'sender' => 'Sender name', |
41 | 41 | ], |
42 | - 'melipayamak' => [ // Install: composer require melipayamak/php |
|
42 | + 'melipayamak' => [// Install: composer require melipayamak/php |
|
43 | 43 | 'username' => 'Your Username', |
44 | 44 | 'password' => 'Your Password', |
45 | 45 | 'from' => 'Your Default From Number', |
46 | 46 | 'flash' => false, |
47 | 47 | ], |
48 | - 'kavenegar' => [ // Install: composer require kavenegar/php |
|
48 | + 'kavenegar' => [// Install: composer require kavenegar/php |
|
49 | 49 | 'apiKey' => 'Your Api Key', |
50 | 50 | 'from' => 'Your Default From Number', |
51 | 51 | ], |
@@ -96,13 +96,13 @@ |
||
96 | 96 | throw new \Exception('Driver not found in config file. Try updating the package.'); |
97 | 97 | } |
98 | 98 | |
99 | - if (! class_exists($this->config['map'][$this->driver])) { |
|
99 | + if (!class_exists($this->config['map'][$this->driver])) { |
|
100 | 100 | throw new \Exception('Driver source not found. Please update the package.'); |
101 | 101 | } |
102 | 102 | |
103 | 103 | $reflect = new \ReflectionClass($this->config['map'][$this->driver]); |
104 | 104 | |
105 | - if (! $reflect->implementsInterface(Contracts\DriverInterface::class)) { |
|
105 | + if (!$reflect->implementsInterface(Contracts\DriverInterface::class)) { |
|
106 | 106 | throw new \Exception("Driver must be an instance of Contracts\DriverInterface."); |
107 | 107 | } |
108 | 108 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | public function to($numbers) |
38 | 38 | { |
39 | 39 | $recipients = is_array($numbers) ? $numbers : [$numbers]; |
40 | - $recipients = array_map(function ($item) { |
|
40 | + $recipients = array_map(function($item) { |
|
41 | 41 | return trim($item); |
42 | 42 | }, array_merge($this->recipients, $recipients)); |
43 | 43 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | public function message($message) |
61 | 61 | { |
62 | - if (! is_string($message)) { |
|
62 | + if (!is_string($message)) { |
|
63 | 63 | throw new \Exception('Message text should be a string.'); |
64 | 64 | } |
65 | 65 | if (trim($message) == '') { |
@@ -25,12 +25,12 @@ |
||
25 | 25 | $manager = new SmsManager; |
26 | 26 | |
27 | 27 | // Use custom driver if exists. |
28 | - if (! empty($message['driver'])) { |
|
28 | + if (!empty($message['driver'])) { |
|
29 | 29 | $manager->withDriver($message['driver']); |
30 | 30 | } |
31 | 31 | |
32 | 32 | // Send notification. |
33 | - return $manager->send($message['body'], function ($sms) use ($message) { |
|
33 | + return $manager->send($message['body'], function($sms) use ($message) { |
|
34 | 34 | $sms->to($message['recipients']); |
35 | 35 | }); |
36 | 36 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | 'SecretKey' => $this->settings->secretKey, |
46 | 46 | ]; |
47 | 47 | $response = $this->client->post( |
48 | - $this->settings->url.'api/Token', |
|
48 | + $this->settings->url . 'api/Token', |
|
49 | 49 | [ |
50 | 50 | 'json' => $body, |
51 | 51 | 'connect_timeout' => 30 |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | 'Mobile' => $recipient, |
89 | 89 | ]; |
90 | 90 | $response = $this->client->post( |
91 | - $this->settings->url.'api/UltraFastSend', |
|
91 | + $this->settings->url . 'api/UltraFastSend', |
|
92 | 92 | [ |
93 | 93 | 'json' => $body, |
94 | 94 | 'headers' => [ |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | // Send message: |
129 | 129 | $response = $this->client->request( |
130 | 130 | 'POST', |
131 | - $this->settings->url.'api/MessageSend', |
|
131 | + $this->settings->url . 'api/MessageSend', |
|
132 | 132 | [ |
133 | 133 | 'json' => $body, |
134 | 134 | 'headers' => [ |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | protected function getResponseData($response) |
153 | 153 | { |
154 | 154 | if ($response->getStatusCode() != 200 && $response->getStatusCode() != 201) { |
155 | - return ['status' => false, 'message' => 'Request Error. '.$response->getReasonPhrase()]; |
|
155 | + return ['status' => false, 'message' => 'Request Error. ' . $response->getReasonPhrase()]; |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | $data = json_decode((string) $response->getBody(), true); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | protected function getResponseData($response) |
66 | 66 | { |
67 | 67 | if ($response->getStatusCode() != 200) { |
68 | - return ['status' => false, 'message' => 'Request Error. '.$response->getReasonPhrase()]; |
|
68 | + return ['status' => false, 'message' => 'Request Error. ' . $response->getReasonPhrase()]; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | $data = json_decode((string) $response->getBody(), true); |
@@ -66,7 +66,7 @@ |
||
66 | 66 | protected function getResponseData($response) |
67 | 67 | { |
68 | 68 | if ($response->getStatusCode() != 200) { |
69 | - return ['status' => false, 'message' => 'Request Error. '.$response->getReasonPhrase()]; |
|
69 | + return ['status' => false, 'message' => 'Request Error. ' . $response->getReasonPhrase()]; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | $data = json_decode((string) $response->getBody(), true); |