Completed
Push — master ( 85eab7...5535f2 )
by Songda
01:44
created
src/Traits/HasHttpRequest.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
      * @param string $body
46 46
      * @param array  $headers
47 47
      *
48
-     * @return array
48
+     * @return string
49 49
      */
50 50
     protected function post($endpoint, $params = [], $body = null, $headers = [])
51 51
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
             'form_params' => $params,
55 55
         ];
56 56
 
57
-        if (! is_null($body)) {
57
+        if (!is_null($body)) {
58 58
             $options = [
59 59
                 'headers' => $headers,
60 60
                 'body'    => $body,
Please login to merge, or discard this patch.
src/Gateways/Wechat/Wechat.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 
148 148
         if (!isset($data['return_code']) || $data['return_code'] !== 'SUCCESS' || $data['result_code'] !== 'SUCCESS') {
149 149
             $error = 'preOrder error:' . $data['return_msg'];
150
-            $error .= isset($data['err_code_des']) ? ' - ' .  $data['err_code_des'] : '';
150
+            $error .= isset($data['err_code_des']) ? ' - ' . $data['err_code_des'] : '';
151 151
             
152 152
             throw new GatewayException(
153 153
                 $error,
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 
207 207
         foreach ($data as $k => $v)
208 208
         {
209
-            if($k != "sign" && $v != "" && !is_array($v)){
209
+            if ($k != "sign" && $v != "" && !is_array($v)) {
210 210
                 $buff .= $k . "=" . $v . "&";
211 211
             }
212 212
         }
@@ -248,19 +248,19 @@  discard block
 block discarded – undo
248 248
      */
249 249
     protected function toXml($data)
250 250
     {
251
-        if(!is_array($data) || count($data) <= 0){
251
+        if (!is_array($data) || count($data) <= 0) {
252 252
             throw new InvalidArgumentException("convert to xml error!invalid array!");
253 253
         }
254 254
         
255 255
         $xml = "<xml>";
256
-        foreach ($data as $key => $val){
257
-            if (is_numeric($val)){
258
-                $xml.="<".$key.">".$val."</".$key.">";
259
-            }else{
260
-                $xml.="<".$key."><![CDATA[".$val."]]></".$key.">";
256
+        foreach ($data as $key => $val) {
257
+            if (is_numeric($val)) {
258
+                $xml .= "<" . $key . ">" . $val . "</" . $key . ">";
259
+            }else {
260
+                $xml .= "<" . $key . "><![CDATA[" . $val . "]]></" . $key . ">";
261 261
             }
262 262
         }
263
-        $xml.="</xml>";
263
+        $xml .= "</xml>";
264 264
 
265 265
         return $xml; 
266 266
     }
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
      */
279 279
     protected function fromXml($xml)
280 280
     {   
281
-        if(!$xml){
281
+        if (!$xml) {
282 282
             throw new InvalidArgumentException("convert to array error !invalid xml");
283 283
         }
284 284
 
Please login to merge, or discard this patch.