Passed
Pull Request — main (#3)
by
unknown
02:51
created
src/Drivers/farazsms.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         $from          = $this->from;
124 124
         $to            = $numbers;
125 125
         $input_data    = $this->data;
126
-        $url = $this->url."?username=" . $username . "&password=" . urlencode($password) . "&from=$from&to=" . json_encode($to) . "&input_data=" . urlencode(json_encode($input_data)) . "&pattern_code=$pattern_code";
126
+        $url = $this->url."?username=".$username."&password=".urlencode($password)."&from=$from&to=".json_encode($to)."&input_data=".urlencode(json_encode($input_data))."&pattern_code=$pattern_code";
127 127
         $handler = curl_init($url);
128 128
         curl_setopt($handler, CURLOPT_CUSTOMREQUEST, "POST");
129 129
         curl_setopt($handler, CURLOPT_POSTFIELDS, $input_data);
@@ -139,12 +139,11 @@  discard block
 block discarded – undo
139 139
     public function message($text)
140 140
     {
141 141
 
142
-        $this->url   = config('sms.drivers.'.$this->drive.'.urlNormal');
142
+        $this->url = config('sms.drivers.'.$this->drive.'.urlNormal');
143 143
 
144 144
         $rcpt_nm = $this->numbers;
145
-        $param = array
146
-        (
147
-            'uname'=> $this->username ,
145
+        $param = array(
146
+            'uname'=> $this->username,
148 147
             'pass'=> $this->password,
149 148
             'from'=>$this->from,
150 149
             'message'=>$text,
Please login to merge, or discard this patch.
src/SmsServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,11 +10,11 @@
 block discarded – undo
10 10
 {
11 11
     public function register()
12 12
     {
13
-        $this->app->singleton('sms',function (){
13
+        $this->app->singleton('sms', function() {
14 14
             return new SmsService();
15 15
         });
16 16
 
17
-        $this->mergeConfigFrom(__DIR__.'/config/sms.php','sms');
17
+        $this->mergeConfigFrom(__DIR__.'/config/sms.php', 'sms');
18 18
 
19 19
     }
20 20
 
Please login to merge, or discard this patch.
src/SmsService.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
     {
68 68
         $class = new $this->class;
69 69
 
70
-       return call_user_func_array(array($class,$key),$params);
70
+        return call_user_func_array(array($class,$key),$params);
71 71
     }
72 72
 
73 73
 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@  discard block
 block discarded – undo
5 5
 class SmsService
6 6
 {
7 7
 
8
-    protected $driver ;
8
+    protected $driver;
9 9
 
10
-    protected $mode ;
10
+    protected $mode;
11 11
 
12
-    protected $class ;
12
+    protected $class;
13 13
 
14 14
 
15 15
     /**
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
      */
30 30
     public function driver($key)
31 31
     {
32
-        $this->driver = $key ;
32
+        $this->driver = $key;
33 33
 
34 34
         $this->class = config('sms.map.'.$this->driver);
35 35
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function text($text)
44 44
     {
45
-        $drive = $this->drive('text',[$text]);
45
+        $drive = $this->drive('text', [$text]);
46 46
 
47 47
         return $drive;
48 48
     }
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public function pattern($code = null)
55 55
     {
56
-        $drive = $this->drive('pattern',[$code]);
56
+        $drive = $this->drive('pattern', [$code]);
57 57
 
58 58
         return $drive;
59 59
     }
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
      * @param array $params
64 64
      * @return mixed
65 65
      */
66
-    public function drive($key,$params = [])
66
+    public function drive($key, $params = [])
67 67
     {
68 68
         $class = new $this->class;
69 69
 
70
-       return call_user_func_array(array($class,$key),$params);
70
+       return call_user_func_array(array($class, $key), $params);
71 71
     }
72 72
 
73 73
 }
Please login to merge, or discard this patch.
src/Drivers/ippanel.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         $from          = $this->from;
124 124
         $to            = $numbers;
125 125
         $input_data    = $this->data;
126
-        $url = $this->url."?username=" . $username . "&password=" . urlencode($password) . "&from=$from&to=" . json_encode($to) . "&input_data=" . urlencode(json_encode($input_data)) . "&pattern_code=$pattern_code";
126
+        $url = $this->url."?username=".$username."&password=".urlencode($password)."&from=$from&to=".json_encode($to)."&input_data=".urlencode(json_encode($input_data))."&pattern_code=$pattern_code";
127 127
         $handler = curl_init($url);
128 128
         curl_setopt($handler, CURLOPT_CUSTOMREQUEST, "POST");
129 129
         curl_setopt($handler, CURLOPT_POSTFIELDS, $input_data);
@@ -139,12 +139,11 @@  discard block
 block discarded – undo
139 139
     public function message($text)
140 140
     {
141 141
 
142
-        $this->url   = config('sms.drivers.'.$this->drive.'.urlNormal');
142
+        $this->url = config('sms.drivers.'.$this->drive.'.urlNormal');
143 143
 
144 144
         $rcpt_nm = $this->numbers;
145
-        $param = array
146
-        (
147
-            'uname'=> $this->username ,
145
+        $param = array(
146
+            'uname'=> $this->username,
148 147
             'pass'=> $this->password,
149 148
             'from'=>$this->from,
150 149
             'message'=>$text,
Please login to merge, or discard this patch.
src/Drivers/kavenegar.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         $token = $this->token ?? $this->password;
127 127
         $url = $this->url.'/'.$token.'/verify/lookup.json';
128 128
         $url .= '?receptor='.$this->numbers[0];
129
-        foreach ($this->data as $patternKey => $patternValue ){
129
+        foreach ($this->data as $patternKey => $patternValue) {
130 130
             $url .= '&'.$patternKey.'='.$patternValue;
131 131
         }
132 132
         $url .= '&template='.$this->pattern_code;
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     {
143 143
         $token = $this->token ?? $this->password;
144 144
         $url = $this->url.'/'.$token.'/sms/send.json';
145
-        $url .= '?receptor='.implode(",",$this->numbers);
145
+        $url .= '?receptor='.implode(",", $this->numbers);
146 146
         $url .= '&sender='.$this->from;
147 147
         $url .= '&message='.$text;
148 148
         $response = Http::get($url)->body();
Please login to merge, or discard this patch.
src/Drivers/smsir.php 1 patch
Spacing   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public function __construct()
41 41
     {
42
-        $this->username = config('sms.drivers.' . $this->drive . '.username');
43
-        $this->password = config('sms.drivers.' . $this->drive . '.password');
44
-        $this->from = config('sms.drivers.' . $this->drive . '.from');
45
-        $this->url = config('sms.drivers.' . $this->drive . '.urlPattern');
42
+        $this->username = config('sms.drivers.'.$this->drive.'.username');
43
+        $this->password = config('sms.drivers.'.$this->drive.'.password');
44
+        $this->from = config('sms.drivers.'.$this->drive.'.from');
45
+        $this->url = config('sms.drivers.'.$this->drive.'.urlPattern');
46 46
     }
47 47
 
48 48
     /**
@@ -208,8 +208,7 @@  discard block
 block discarded – undo
208 208
     {
209 209
         $inputs = $this->setMessageExceptions();
210 210
 
211
-        $param = array
212
-        (
211
+        $param = array(
213 212
             'lineNumber'  => $this->from,
214 213
             'MessageText' => $text,
215 214
             'Mobiles'     => json_encode($inputs['numbers']),
@@ -230,11 +229,11 @@  discard block
 block discarded – undo
230 229
 
231 230
     private function setMessageExceptions()
232 231
     {
233
-        $apiKey = config('sms.drivers.' . $this->drive . '.apiKey');
232
+        $apiKey = config('sms.drivers.'.$this->drive.'.apiKey');
234 233
         if ($apiKey == '')
235 234
             throw new \Exception('The apiKey of SMS.ir muse be set in config');
236 235
 
237
-        $this->url = config('sms.drivers.' . $this->drive . '.urlNormal');
236
+        $this->url = config('sms.drivers.'.$this->drive.'.urlNormal');
238 237
         if ($this->url == '')
239 238
             throw new \Exception('The url of SMS.ir muse be set in config');
240 239
 
Please login to merge, or discard this patch.