Passed
Push — v6 ( 20d195...68f5c0 )
by 光春
03:59
created
src/service/ksyun/bin/unit/PUnit.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 require_once "../core/Logger.php";
3
-class PUnit{
4
-	function assertEquals($value,$expected,$info = NULL){
5
-		if($value != $expected){
3
+class PUnit {
4
+	function assertEquals($value, $expected, $info = NULL) {
5
+		if ($value != $expected) {
6 6
 			throw new Exception($info." expected ".$expected." but ".$value);
7 7
 		}
8 8
 	}
9
-	function run($torun = NULL){
9
+	function run($torun = NULL) {
10 10
    		$r = new ReflectionClass($this);
11
-    	foreach($r->getMethods() as $key=>$methodObj){
12
-      	  if($methodObj->isPrivate())
11
+    	foreach ($r->getMethods() as $key=>$methodObj) {
12
+      	  if ($methodObj->isPrivate())
13 13
            		 $methods[$key]['type'] = 'private';
14
-        	elseif($methodObj->isProtected())
14
+        	elseif ($methodObj->isProtected())
15 15
         	     $methods[$key]['type'] = 'protected';
16 16
       		else
17 17
            		 $methods[$key]['type'] = 'public';
@@ -21,32 +21,32 @@  discard block
 block discarded – undo
21 21
         $before = NULL;
22 22
         $after = NULL;
23 23
         foreach ($methods as $method) {
24
-          if($method["class"] != "PUnit"&&$method["name"] == "before"){
24
+          if ($method["class"] != "PUnit" && $method["name"] == "before") {
25 25
             $before = $method;
26 26
           }
27
-          if($method["class"] != "PUnit"&&$method["name"] == "after"){
27
+          if ($method["class"] != "PUnit" && $method["name"] == "after") {
28 28
             $after = $method;
29 29
           }
30 30
         }
31 31
        	$error = array();
32 32
        	$success = array();
33 33
        	foreach ($methods as $method) {
34
-       		if($method["class"] != "PUnit"&&substr($method["name"],0,4) == "test"){
35
-            if($torun !== NULL){
36
-              if(!in_array($method["name"],$torun))
34
+       		if ($method["class"] != "PUnit" && substr($method["name"], 0, 4) == "test") {
35
+            if ($torun !== NULL) {
36
+              if (!in_array($method["name"], $torun))
37 37
                 continue;
38 38
             }
39
-       			try{
40
-       				if($method["type"] == "public"){
39
+       			try {
40
+       				if ($method["type"] == "public") {
41 41
                 $log = new Logger();
42 42
                 $log->info("Run unit --->".$method["name"]);
43
-                if($before!=NULL)
43
+                if ($before != NULL)
44 44
                   $this->$before["name"]();
45 45
        					$this->$method["name"]();
46
-       					array_push($success,$method["name"]);
46
+       					array_push($success, $method["name"]);
47 47
        				}
48
-       			}catch(Exception $e){
49
-       				$error[$method["name"]]="".$e;
48
+       			} catch (Exception $e) {
49
+       				$error[$method["name"]] = "".$e;
50 50
        			}
51 51
        		}
52 52
        	}
Please login to merge, or discard this patch.
src/service/ksyun/Ks3Service.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         if (empty($this->accessKeyID) || empty($this->accessKeySecret) || empty($this->endpoint)) {
82 82
             $this->getConfig();
83 83
         }
84
-        require_once(__DIR__ . "/bin/Ks3Client.class.php");
84
+        require_once(__DIR__."/bin/Ks3Client.class.php");
85 85
         $client = new Ks3Client($this->accessKeyID, $this->accessKeySecret, $this->endpoint);
86 86
         if (empty($this->bucket)) {
87 87
             $this->getConfig();
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
             "Key" => $object,
93 93
             "Content" => [
94 94
                 //要上传的内容
95
-                "content" => $content,//可以是文件路径或者resource,如果文件大于2G,请提供文件路径
95
+                "content" => $content, //可以是文件路径或者resource,如果文件大于2G,请提供文件路径
96 96
                 "seek_position" => 0//跳过文件开头?个字节
97 97
             ],
98
-            "ACL" => "public-read",//可以设置访问权限,合法值,private、public-read
98
+            "ACL" => "public-read", //可以设置访问权限,合法值,private、public-read
99 99
             "ObjectMeta" => [
100 100
                 //设置object的元数据,可以设置"Cache-Control","Content-Disposition","Content-Encoding","Content-Length","Content-MD5","Content-Type","Expires"。当设置了Content-Length时,最后上传的为从seek_position开始向后Content-Length个字节的内容。当设置了Content-MD5时,系统会在服务端进行md5校验。
101 101
                 "Content-Type" => "binay/ocet-stream"
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         ];
109 109
         try {
110 110
             $client->putObjectByFile($args);
111
-            return config('dtapp.ksyun.ks3.url', '') . $object;
111
+            return config('dtapp.ksyun.ks3.url', '').$object;
112 112
         } catch (Ks3ServiceException $e) {
113 113
             return false;
114 114
         }
Please login to merge, or discard this patch.
src/service/DingTalkService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
             $data['msgtype'] = $this->msg_type;
84 84
         }
85 85
         $result = HttpService::instance()
86
-            ->url("{$this->oapi_url}robot/send?access_token=" . $this->access_token)
86
+            ->url("{$this->oapi_url}robot/send?access_token=".$this->access_token)
87 87
             ->data($data)
88 88
             ->post()
89 89
             ->toArray();
Please login to merge, or discard this patch.
src/service/upyun/UssService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,6 +80,6 @@
 block discarded – undo
80 80
         $client = new Upyun($serviceConfig);
81 81
         $file = fopen($filePath, 'r');
82 82
         $client->write($object, $file);
83
-        return config('dtapp.upyun.uss.url', '') . $object;
83
+        return config('dtapp.upyun.uss.url', '').$object;
84 84
     }
85 85
 }
Please login to merge, or discard this patch.
src/service/baidu/BosService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,6 +96,6 @@
 block discarded – undo
96 96
             $this->getConfig();
97 97
         }
98 98
         $client->putObjectFromFile($this->bucket, $object, $filePath);
99
-        return config('dtapp.baidu.bos.url', '') . $object;
99
+        return config('dtapp.baidu.bos.url', '').$object;
100 100
     }
101 101
 }
Please login to merge, or discard this patch.
src/cache/Mysql.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         $result = Db::table($this->table)
136 136
             ->where('cache_name', $this->cache_name)
137 137
             ->update([
138
-                'cache_value' => $cache_value + $int
138
+                'cache_value' => $cache_value+$int
139 139
             ]);
140 140
         return $result ? true : false;
141 141
     }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         $result = Db::table($this->table)
154 154
             ->where('cache_name', $this->cache_name)
155 155
             ->update([
156
-                'cache_value' => $cache_value - $int
156
+                'cache_value' => $cache_value-$int
157 157
             ]);
158 158
         return $result ? true : false;
159 159
     }
Please login to merge, or discard this patch.
src/helper/Decimals.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 // | Packagist 地址 :https://packagist.org/packages/liguangchun/think-library
18 18
 // +----------------------------------------------------------------------
19 19
 
20
-declare (strict_types=1);
20
+declare(strict_types=1);
21 21
 
22 22
 namespace DtApp\ThinkLibrary\helper;
23 23
 
Please login to merge, or discard this patch.
src/helper/Pregs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 // | Packagist 地址 :https://packagist.org/packages/liguangchun/think-library
18 18
 // +----------------------------------------------------------------------
19 19
 
20
-declare (strict_types=1);
20
+declare(strict_types=1);
21 21
 
22 22
 namespace DtApp\ThinkLibrary\helper;
23 23
 
Please login to merge, or discard this patch.
src/facade/Strings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 // | Packagist 地址 :https://packagist.org/packages/liguangchun/think-library
18 18
 // +----------------------------------------------------------------------
19 19
 
20
-declare (strict_types=1);
20
+declare(strict_types=1);
21 21
 
22 22
 namespace DtApp\ThinkLibrary\facade;
23 23
 
Please login to merge, or discard this patch.