@@ -123,7 +123,7 @@ discard block |
||
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 |
||
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, |
@@ -48,10 +48,11 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function send() |
50 | 50 | { |
51 | - if ($this->method == 'pattern') |
|
52 | - $res = $this->sendPattern(); |
|
53 | - else |
|
54 | - $res = $this->message($this->text); |
|
51 | + if ($this->method == 'pattern') { |
|
52 | + $res = $this->sendPattern(); |
|
53 | + } else { |
|
54 | + $res = $this->message($this->text); |
|
55 | + } |
|
55 | 56 | return $res; |
56 | 57 | } |
57 | 58 | |
@@ -73,8 +74,9 @@ discard block |
||
73 | 74 | public function pattern($pattern_code = null) |
74 | 75 | { |
75 | 76 | $this->method = 'pattern'; |
76 | - if ($pattern_code) |
|
77 | - $this->pattern_code = $pattern_code; |
|
77 | + if ($pattern_code) { |
|
78 | + $this->pattern_code = $pattern_code; |
|
79 | + } |
|
78 | 80 | return $this; |
79 | 81 | } |
80 | 82 |