Passed
Push — v6 ( 20d195...68f5c0 )
by 光春
03:59
created
src/service/ksyun/bin/unit/PUnit.php 3 patches
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -1,60 +1,60 @@
 block discarded – undo
1 1
 <?php
2 2
 require_once "../core/Logger.php";
3 3
 class PUnit{
4
-	function assertEquals($value,$expected,$info = NULL){
5
-		if($value != $expected){
6
-			throw new Exception($info." expected ".$expected." but ".$value);
7
-		}
8
-	}
9
-	function run($torun = NULL){
10
-   		$r = new ReflectionClass($this);
11
-    	foreach($r->getMethods() as $key=>$methodObj){
12
-      	  if($methodObj->isPrivate())
13
-           		 $methods[$key]['type'] = 'private';
14
-        	elseif($methodObj->isProtected())
15
-        	     $methods[$key]['type'] = 'protected';
16
-      		else
17
-           		 $methods[$key]['type'] = 'public';
18
-        	$methods[$key]['name'] = $methodObj->name;
19
-       		$methods[$key]['class'] = $methodObj->class;
20
-       	}
4
+    function assertEquals($value,$expected,$info = NULL){
5
+        if($value != $expected){
6
+            throw new Exception($info." expected ".$expected." but ".$value);
7
+        }
8
+    }
9
+    function run($torun = NULL){
10
+            $r = new ReflectionClass($this);
11
+        foreach($r->getMethods() as $key=>$methodObj){
12
+            if($methodObj->isPrivate())
13
+                    $methods[$key]['type'] = 'private';
14
+            elseif($methodObj->isProtected())
15
+                    $methods[$key]['type'] = 'protected';
16
+                else
17
+                    $methods[$key]['type'] = 'public';
18
+            $methods[$key]['name'] = $methodObj->name;
19
+                $methods[$key]['class'] = $methodObj->class;
20
+            }
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
-          }
27
-          if($method["class"] != "PUnit"&&$method["name"] == "after"){
26
+            }
27
+            if($method["class"] != "PUnit"&&$method["name"] == "after"){
28 28
             $after = $method;
29
-          }
29
+            }
30 30
         }
31
-       	$error = array();
32
-       	$success = array();
33
-       	foreach ($methods as $method) {
34
-       		if($method["class"] != "PUnit"&&substr($method["name"],0,4) == "test"){
31
+            $error = array();
32
+            $success = array();
33
+            foreach ($methods as $method) {
34
+                if($method["class"] != "PUnit"&&substr($method["name"],0,4) == "test"){
35 35
             if($torun !== NULL){
36
-              if(!in_array($method["name"],$torun))
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 43
                 if($before!=NULL)
44
-                  $this->$before["name"]();
45
-       					$this->$method["name"]();
46
-       					array_push($success,$method["name"]);
47
-       				}
48
-       			}catch(Exception $e){
49
-       				$error[$method["name"]]="".$e;
50
-       			}
51
-       		}
52
-       	}
53
-       	echo "\r\nPHP Unit-----------error"."\r\n";
54
-       	print_r($error);
44
+                    $this->$before["name"]();
45
+                            $this->$method["name"]();
46
+                            array_push($success,$method["name"]);
47
+                        }
48
+                    }catch(Exception $e){
49
+                        $error[$method["name"]]="".$e;
50
+                    }
51
+                }
52
+            }
53
+            echo "\r\nPHP Unit-----------error"."\r\n";
54
+            print_r($error);
55 55
         echo "PHP Unit-----------result"."\r\n";
56 56
         echo "total:".(count($success)+count($error)).",success:".count($success).",error:".count($error)."\r\n";
57 57
 
58
-	}
58
+    }
59 59
 }
60 60
 ?>
61 61
\ No newline at end of file
Please login to merge, or discard this 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.
Braces   +14 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,12 +9,13 @@  discard block
 block discarded – undo
9 9
 	function run($torun = NULL){
10 10
    		$r = new ReflectionClass($this);
11 11
     	foreach($r->getMethods() as $key=>$methodObj){
12
-      	  if($methodObj->isPrivate())
13
-           		 $methods[$key]['type'] = 'private';
14
-        	elseif($methodObj->isProtected())
15
-        	     $methods[$key]['type'] = 'protected';
16
-      		else
17
-           		 $methods[$key]['type'] = 'public';
12
+      	  if($methodObj->isPrivate()) {
13
+      	             		 $methods[$key]['type'] = 'private';
14
+      	  } elseif($methodObj->isProtected()) {
15
+        	        	     $methods[$key]['type'] = 'protected';
16
+        	} else {
17
+      		           		 $methods[$key]['type'] = 'public';
18
+      		}
18 19
         	$methods[$key]['name'] = $methodObj->name;
19 20
        		$methods[$key]['class'] = $methodObj->class;
20 21
        	}
@@ -33,19 +34,21 @@  discard block
 block discarded – undo
33 34
        	foreach ($methods as $method) {
34 35
        		if($method["class"] != "PUnit"&&substr($method["name"],0,4) == "test"){
35 36
             if($torun !== NULL){
36
-              if(!in_array($method["name"],$torun))
37
-                continue;
37
+              if(!in_array($method["name"],$torun)) {
38
+                              continue;
39
+              }
38 40
             }
39 41
        			try{
40 42
        				if($method["type"] == "public"){
41 43
                 $log = new Logger();
42 44
                 $log->info("Run unit --->".$method["name"]);
43
-                if($before!=NULL)
44
-                  $this->$before["name"]();
45
+                if($before!=NULL) {
46
+                                  $this->$before["name"]();
47
+                }
45 48
        					$this->$method["name"]();
46 49
        					array_push($success,$method["name"]);
47 50
        				}
48
-       			}catch(Exception $e){
51
+       			} catch(Exception $e){
49 52
        				$error[$method["name"]]="".$e;
50 53
        			}
51 54
        		}
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.