Completed
Push — master ( cd788c...fa34ae )
by Kazi Mainuddin
01:34
created
src/Provider/SmsServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,13 +18,13 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Config/sms.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         ],
Please login to merge, or discard this patch.
src/SmsManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,13 +96,13 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Abstracts/Driver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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) == '') {
Please login to merge, or discard this patch.
src/Channels/SmsChannel.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,12 +25,12 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Drivers/Smsir.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Drivers/Linkmobility.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Drivers/Textlocal.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.