Passed
Push — v6 ( fbfd37...6aa863 )
by 光春
03:18
created
src/service/bt/ApiService.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
         $this->getHttp();
393 393
         if ($this->where['type'] === 'sites') {
394 394
             $this->getDataWithOrderOpt();
395
-        } else {
395
+        }else {
396 396
             $this->getDataWithCount();
397 397
         }
398 398
         if (empty($this->backtrack)) {
@@ -421,8 +421,8 @@  discard block
 block discarded – undo
421 421
             throw new DtaException('请检查panel参数');
422 422
         }
423 423
         //定义cookie保存位置
424
-        $file = app()->getRootPath() . 'runtime/dtapp/bt/cookie/';
425
-        $cookie_file = $file . md5($this->panel) . '.cookie';
424
+        $file = app()->getRootPath().'runtime/dtapp/bt/cookie/';
425
+        $cookie_file = $file.md5($this->panel).'.cookie';
426 426
         if (empty(Files::judgeContents($file)) && !mkdir($file, 0777, true) && !is_dir($file)) {
427 427
             throw new \RuntimeException(sprintf('Directory "%s" was not created', $file));
428 428
         }
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
     {
455 455
         $start = strpos($str, "共");
456 456
         $end = strpos($str, "条数据");
457
-        $count = substr($str, $start + 3, $end - $start - 3);
457
+        $count = substr($str, $start+3, $end-$start-3);
458 458
         if (empty($count)) {
459 459
             return 0;
460 460
         }
Please login to merge, or discard this patch.
src/service/jd/UnionService.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         $sign = $this->createSign();
146 146
         //组织参数
147 147
         $strParam = $this->createStrParam();
148
-        $strParam .= 'sign=' . $sign;
148
+        $strParam .= 'sign='.$sign;
149 149
         //访问服务
150 150
         $result = file_get_contents("{$this->url}?{$strParam}");
151 151
         $result = json_decode($result, true);
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
         $this->params['sign_method'] = $this->sign_method;
352 352
         $this->params['param_json'] = json_encode($this->param, JSON_UNESCAPED_UNICODE);
353 353
         $this->http();
354
-        $response = Strings::replace('.', '_', $this->method) . "_response";
354
+        $response = Strings::replace('.', '_', $this->method)."_response";
355 355
         if (isset($this->output[$response]['result'])) {
356 356
             if (is_array($this->output[$response]['result'])) {
357 357
                 return $this->output[$response]['result'];
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
         ksort($this->params);
389 389
         foreach ($this->params as $key => $val) {
390 390
             if ($key !== '' && $val !== '') {
391
-                $sign .= $key . $val;
391
+                $sign .= $key.$val;
392 392
             }
393 393
         }
394 394
         $sign .= $this->secret_key;
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
         $strParam = '';
406 406
         foreach ($this->params as $key => $val) {
407 407
             if ($key !== '' && $val !== '') {
408
-                $strParam .= $key . '=' . urlencode($val) . '&';
408
+                $strParam .= $key.'='.urlencode($val).'&';
409 409
             }
410 410
         }
411 411
         return $strParam;
Please login to merge, or discard this patch.
src/service/curl/BtService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
     private function http(): self
142 142
     {
143 143
         $ch = curl_init();
144
-        curl_setopt($ch, CURLOPT_URL, $this->panel . $this->url);
144
+        curl_setopt($ch, CURLOPT_URL, $this->panel.$this->url);
145 145
         curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
146 146
         curl_setopt($ch, CURLOPT_POST, 1);
147 147
         curl_setopt($ch, CURLOPT_POSTFIELDS, array_merge($this->getKeyData(), $this->data));
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
     {
166 166
         $time = time();
167 167
         return array(
168
-            'request_token' => md5($time . '' . md5($this->key)),
168
+            'request_token' => md5($time.''.md5($this->key)),
169 169
             'request_time' => $time
170 170
         );
171 171
     }
Please login to merge, or discard this patch.
src/service/curl/HttpService.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     {
70 70
         if (is_array($str)) {
71 71
             $this->data = json_encode($str, JSON_UNESCAPED_UNICODE);
72
-        } else {
72
+        }else {
73 73
             $this->data = $str;
74 74
         }
75 75
         return $this;
@@ -165,13 +165,13 @@  discard block
 block discarded – undo
165 165
         }
166 166
         if ($this->method === 'GET') {
167 167
             $this->httpGet();
168
-        } else if ($this->method === 'POST') {
168
+        }else if ($this->method === 'POST') {
169 169
             $this->httpPost();
170
-        } else if ($this->method === 'XML') {
170
+        }else if ($this->method === 'XML') {
171 171
             $this->httpXml();
172
-        } else if ($this->method === 'FILE') {
172
+        }else if ($this->method === 'FILE') {
173 173
             $this->httpFile();
174
-        } else {
174
+        }else {
175 175
             throw new HttpException(404, '请求方式异常');
176 176
         }
177 177
         if (empty($is)) {
@@ -213,12 +213,12 @@  discard block
 block discarded – undo
213 213
     {
214 214
         $ch = curl_init();
215 215
         curl_setopt($ch, CURLOPT_URL, $this->url);
216
-        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: ' . $this->headers));
216
+        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: '.$this->headers));
217 217
         curl_setopt($ch, CURLOPT_HEADER, 0);
218 218
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
219 219
         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
220 220
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 跳过证书检查
221
-        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);  // 从证书中检查SSL加密算法是否存在
221
+        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // 从证书中检查SSL加密算法是否存在
222 222
         curl_setopt($ch, CURLOPT_POST, 1);
223 223
         curl_setopt($ch, CURLOPT_POSTFIELDS, $this->data);
224 224
         curl_setopt($ch, CURLOPT_TIMEOUT, 10);
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
         curl_setopt($ch, CURLOPT_TIMEOUT, 40);
255 255
         set_time_limit(0);
256 256
         if (!empty($this->headers)) {
257
-            curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: ' . $this->headers));
257
+            curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: '.$this->headers));
258 258
         }
259 259
         //运行curl
260 260
         $data = curl_exec($ch);
@@ -281,17 +281,17 @@  discard block
 block discarded – undo
281 281
             curl_setopt($ch, CURLOPT_SSLKEYTYPE, 'PEM');
282 282
             curl_setopt($ch, CURLOPT_SSLCERT, $this->cert['cert']);
283 283
             curl_setopt($ch, CURLOPT_SSLKEY, $this->cert['key']);
284
-        } else if (strpos($this->url, 'https') === 0) {
284
+        }else if (strpos($this->url, 'https') === 0) {
285 285
             curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 信任任何证书
286 286
             curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // 检查证书中是否设置域名
287 287
         }
288 288
         if (!empty($this->headers)) {
289
-            curl_setopt($ch, CURLOPT_HTTPHEADER, array('content-type: ' . $this->headers));
289
+            curl_setopt($ch, CURLOPT_HTTPHEADER, array('content-type: '.$this->headers));
290 290
         }
291
-        curl_setopt($ch, CURLOPT_HEADER, true);    // 是否需要响应 header
291
+        curl_setopt($ch, CURLOPT_HEADER, true); // 是否需要响应 header
292 292
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
293 293
         $output = curl_exec($ch);
294
-        $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);    // 获得响应结果里的:头大小
294
+        $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); // 获得响应结果里的:头大小
295 295
         $response_body = substr($output, $header_size);
296 296
         curl_close($ch);
297 297
         $this->output = $response_body;
Please login to merge, or discard this patch.
src/service/wechat/WebAppService.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             $this->scope = $scope;
175 175
         } elseif ($scope === "snsapi_userinfo") {
176 176
             $this->scope = $scope;
177
-        } else {
177
+        }else {
178 178
             throw new DtaException("请检查scope参数");
179 179
         }
180 180
         return $this;
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
         // 获取数据
325 325
         $accessToken = $this->getAccessToken();
326 326
         if (!isset($accessToken['access_token'])) {
327
-            throw  new DtaException("获取access_token错误," . $accessToken['errmsg']);
327
+            throw  new DtaException("获取access_token错误,".$accessToken['errmsg']);
328 328
         }
329 329
         $res = HttpService::instance()
330 330
             ->url("https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token={$accessToken['access_token']}&type=jsapi")
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
             // 获取数据
334 334
             $accessToken = $this->getAccessToken();
335 335
             if (!isset($accessToken['access_token'])) {
336
-                throw  new DtaException("获取access_token错误," . $accessToken['errmsg']);
336
+                throw  new DtaException("获取access_token错误,".$accessToken['errmsg']);
337 337
             }
338 338
             $res = HttpService::instance()
339 339
                 ->url("https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token={$accessToken['access_token']}&type=jsapi")
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
         $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
374 374
         $str = "";
375 375
         for ($i = 0; $i < $length; $i++) {
376
-            $str .= $chars[random_int(0, strlen($chars) - 1)];
376
+            $str .= $chars[random_int(0, strlen($chars)-1)];
377 377
         }
378 378
         return $str;
379 379
     }
@@ -645,22 +645,22 @@  discard block
 block discarded – undo
645 645
                 $accessToken_res = HttpService::instance()
646 646
                     ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}")
647 647
                     ->toArray();
648
-                $accessToken_res['expires_time'] = time() + 6000;
648
+                $accessToken_res['expires_time'] = time()+6000;
649 649
                 file_put_contents($file, json_encode($accessToken_res, JSON_UNESCAPED_UNICODE));
650 650
                 $accessToken = $accessToken_res;
651
-            } else if (!isset($accessToken['access_token'])) {
651
+            }else if (!isset($accessToken['access_token'])) {
652 652
                 // 内容不存在
653 653
                 $accessToken_res = HttpService::instance()
654 654
                     ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}")
655 655
                     ->toArray();
656
-                $accessToken_res['expires_time'] = time() + 6000;
656
+                $accessToken_res['expires_time'] = time()+6000;
657 657
                 file_put_contents($file, json_encode($accessToken_res, JSON_UNESCAPED_UNICODE));
658 658
                 $accessToken = $accessToken_res;
659
-            } else if ($accessToken['expires_time'] <= time()) {
659
+            }else if ($accessToken['expires_time'] <= time()) {
660 660
                 $accessToken_res = HttpService::instance()
661 661
                     ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}")
662 662
                     ->toArray();
663
-                $accessToken_res['expires_time'] = time() + 6000;
663
+                $accessToken_res['expires_time'] = time()+6000;
664 664
                 file_put_contents($file, json_encode($accessToken_res, JSON_UNESCAPED_UNICODE));
665 665
                 $accessToken = $accessToken_res;
666 666
             }
@@ -672,15 +672,15 @@  discard block
 block discarded – undo
672 672
                     $accessToken_res = HttpService::instance()
673 673
                         ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}")
674 674
                         ->toArray();
675
-                    $accessToken_res['expires_time'] = time() + 6000;
675
+                    $accessToken_res['expires_time'] = time()+6000;
676 676
                     file_put_contents($file, json_encode($accessToken_res, JSON_UNESCAPED_UNICODE));
677 677
                     $accessToken = $accessToken_res;
678 678
                 }
679
-            } else {
679
+            }else {
680 680
                 $accessToken_res = HttpService::instance()
681 681
                     ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}")
682 682
                     ->toArray();
683
-                $accessToken_res['expires_time'] = time() + 6000;
683
+                $accessToken_res['expires_time'] = time()+6000;
684 684
                 file_put_contents($file, json_encode($accessToken_res, JSON_UNESCAPED_UNICODE));
685 685
                 $accessToken = $accessToken_res;
686 686
             }
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
             $cache_mysql_value = dtacache($file);
696 696
             if (!empty($cache_mysql_value)) {
697 697
                 $access_token['access_token'] = $cache_mysql_value;
698
-            } else {
698
+            }else {
699 699
                 // 获取远程Token
700 700
                 $accessToken_res = HttpService::instance()
701 701
                     ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}")
@@ -767,11 +767,11 @@  discard block
 block discarded – undo
767 767
         // 转成字符串
768 768
         $stringA = Urls::toParams($array);
769 769
         // 在字符串接商户支付秘钥
770
-        $stringSignTemp = "{$stringA}&key=" . $this->mch_key;
770
+        $stringSignTemp = "{$stringA}&key=".$this->mch_key;
771 771
         //步骤四:MD5或HMAC-SHA256C加密
772 772
         if ($hmacsha256) {
773 773
             $str = hash_hmac("sha256", $stringSignTemp, $this->mch_key);
774
-        } else {
774
+        }else {
775 775
             $str = md5($stringSignTemp);
776 776
         }
777 777
         //符转大写
@@ -795,8 +795,8 @@  discard block
 block discarded – undo
795 795
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
796 796
 
797 797
         //试试手气新增,增加之后 curl 不报 60# 错误,可以请求到微信的响应
798
-        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);  //不验证 SSL 证书
799
-        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);//不验证 SSL 证书域名
798
+        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //不验证 SSL 证书
799
+        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); //不验证 SSL 证书域名
800 800
         //post提交方式
801 801
         curl_setopt($ch, CURLOPT_POST, TRUE);
802 802
         curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
@@ -810,6 +810,6 @@  discard block
 block discarded – undo
810 810
 
811 811
         $error = curl_errno($ch);
812 812
         curl_close($ch);
813
-        return "curl error, error code " . $error;
813
+        return "curl error, error code ".$error;
814 814
     }
815 815
 }
Please login to merge, or discard this patch.
src/service/wechat/QyService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@
 block discarded – undo
99 99
             $data['msgtype'] = $this->msgType;
100 100
         }
101 101
         $result = HttpService::instance()
102
-            ->url("https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=" . $this->key)
102
+            ->url("https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=".$this->key)
103 103
             ->data($data)
104 104
             ->toArray();
105 105
         return $result['errcode'] === 0;
Please login to merge, or discard this patch.
src/service/wechat/MiniService.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -427,21 +427,21 @@  discard block
 block discarded – undo
427 427
                 $accessToken_res = HttpService::instance()
428 428
                     ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}")
429 429
                     ->toArray();
430
-                $accessToken_res['expires_time'] = time() + 6000;
430
+                $accessToken_res['expires_time'] = time()+6000;
431 431
                 file_put_contents($file, json_encode($accessToken_res, JSON_UNESCAPED_UNICODE));
432 432
                 $accessToken = $accessToken_res;
433
-            } else if (!isset($accessToken['access_token'])) {
433
+            }else if (!isset($accessToken['access_token'])) {
434 434
                 $accessToken_res = HttpService::instance()
435 435
                     ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}")
436 436
                     ->toArray();
437
-                $accessToken_res['expires_time'] = time() + 6000;
437
+                $accessToken_res['expires_time'] = time()+6000;
438 438
                 file_put_contents($file, json_encode($accessToken_res, JSON_UNESCAPED_UNICODE));
439 439
                 $accessToken = $accessToken_res;
440
-            } else if ($accessToken['expires_time'] <= time()) {
440
+            }else if ($accessToken['expires_time'] <= time()) {
441 441
                 $accessToken_res = HttpService::instance()
442 442
                     ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}")
443 443
                     ->toArray();
444
-                $accessToken_res['expires_time'] = time() + 6000;
444
+                $accessToken_res['expires_time'] = time()+6000;
445 445
                 file_put_contents($file, json_encode($accessToken_res, JSON_UNESCAPED_UNICODE));
446 446
                 $accessToken = $accessToken_res;
447 447
             }
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
             $cache_mysql_value = dtacache($file);
457 457
             if (!empty($cache_mysql_value)) {
458 458
                 $access_token['access_token'] = $cache_mysql_value;
459
-            } else {
459
+            }else {
460 460
                 $accessToken_res = HttpService::instance()
461 461
                     ->url("https://api.weixin.qq.com/cgi-bin/token?grant_type={$this->grant_type}&appid={$this->app_id}&secret={$this->app_secret}")
462 462
                     ->toArray();
Please login to merge, or discard this patch.
src/service/taobao/TbkService.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -596,12 +596,12 @@  discard block
 block discarded – undo
596 596
         $sign = $this->createSign();
597 597
         //组织参数
598 598
         $strParam = $this->createStrParam();
599
-        $strParam .= 'sign=' . $sign;
599
+        $strParam .= 'sign='.$sign;
600 600
         //访问服务
601 601
         if (empty($this->sandbox)) {
602
-            $url = 'http://gw.api.taobao.com/router/rest?' . $strParam;
603
-        } else {
604
-            $url = 'http://gw.api.tbsandbox.com/router/rest?' . $strParam;
602
+            $url = 'http://gw.api.taobao.com/router/rest?'.$strParam;
603
+        }else {
604
+            $url = 'http://gw.api.tbsandbox.com/router/rest?'.$strParam;
605 605
         }
606 606
         $result = file_get_contents($url);
607 607
         $result = json_decode($result, true);
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
         ksort($this->param);
626 626
         foreach ($this->param as $key => $val) {
627 627
             if ($key !== '' && $val !== '') {
628
-                $sign .= $key . $val;
628
+                $sign .= $key.$val;
629 629
             }
630 630
         }
631 631
         $sign .= $this->app_secret;
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
         $strParam = '';
643 643
         foreach ($this->param as $key => $val) {
644 644
             if ($key !== '' && $val !== '') {
645
-                $strParam .= $key . '=' . urlencode($val) . '&';
645
+                $strParam .= $key.'='.urlencode($val).'&';
646 646
             }
647 647
         }
648 648
         return $strParam;
Please login to merge, or discard this patch.
src/service/pinduoduo/JinBaoService.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
         $sign = $this->createSign();
126 126
         //组织参数
127 127
         $strParam = $this->createStrParam();
128
-        $strParam .= 'sign=' . $sign;
128
+        $strParam .= 'sign='.$sign;
129 129
         //访问服务
130
-        $url = "{$this->url}?" . $strParam;
130
+        $url = "{$this->url}?".$strParam;
131 131
         $result = file_get_contents($url);
132 132
         $result = json_decode($result, true);
133 133
         $this->output = $result;
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
     {
518 518
         if (is_object($object)) {
519 519
             $arr = (array)($object);
520
-        } else {
520
+        }else {
521 521
             $arr = &$object;
522 522
         }
523 523
         if (is_array($arr)) {
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
         ksort($this->param);
546 546
         foreach ($this->param as $key => $val) {
547 547
             if ($key !== '' && $val !== '') {
548
-                $sign .= $key . $val;
548
+                $sign .= $key.$val;
549 549
             }
550 550
         }
551 551
         $sign .= $this->client_secret;
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
         $strParam = '';
563 563
         foreach ($this->param as $key => $val) {
564 564
             if ($key !== '' && $val !== '' && !is_array($val)) {
565
-                $strParam .= $key . '=' . urlencode($val) . '&';
565
+                $strParam .= $key.'='.urlencode($val).'&';
566 566
             }
567 567
         }
568 568
         return $strParam;
Please login to merge, or discard this patch.