Passed
Branch v6 (9335b3)
by 光春
04:49
created
src/helper/Dates.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/Times.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 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
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         date_default_timezone_set('Asia/Shanghai');
59 59
         $msec = 0;
60 60
         list($msec, $sec) = explode(' ', microtime());
61
-        return (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000);
61
+        return (float)sprintf('%.0f', (floatval($msec)+floatval($sec))*1000);
62 62
     }
63 63
 
64 64
     /**
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         date_default_timezone_set('Asia/Shanghai');
73 73
         $end_time = strtotime($end_time);
74 74
         $start_time = $start_time == '' ? time() : strtotime($start_time);
75
-        return $end_time - $start_time;
75
+        return $end_time-$start_time;
76 76
     }
77 77
 
78 78
     /**
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         if (empty($time)) {
112 112
             $time = time();
113 113
         }
114
-        return date($format, $time - $mun);
114
+        return date($format, $time-$mun);
115 115
     }
116 116
 
117 117
     /**
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         if (empty($time)) {
128 128
             $time = time();
129 129
         }
130
-        return date($format, $time + $mun);
130
+        return date($format, $time+$mun);
131 131
     }
132 132
 
133 133
 
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
     {
142 142
         date_default_timezone_set('Asia/Shanghai');
143 143
         $date = date('H:i');
144
-        $curTime = strtotime($date);//当前时分
145
-        $assignTime1 = strtotime($start);//获得指定分钟时间戳,00:00
146
-        $assignTime2 = strtotime($end);//获得指定分钟时间戳,01:00
144
+        $curTime = strtotime($date); //当前时分
145
+        $assignTime1 = strtotime($start); //获得指定分钟时间戳,00:00
146
+        $assignTime2 = strtotime($end); //获得指定分钟时间戳,01:00
147 147
         $result = false;
148 148
         if ($curTime > $assignTime1 && $curTime < $assignTime2) {
149 149
             $result = true;
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/helper/UnIqIds.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 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
 
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
         if (intval($type) === 3) {
49 49
             $chars = "{$numbs}{$chars}";
50 50
         }
51
-        $string = $prefix . $chars[rand(1, strlen($chars) - 1)];
51
+        $string = $prefix.$chars[rand(1, strlen($chars)-1)];
52 52
         if (isset($chars)) {
53
-            while (strlen($string) < $size) $string .= $chars[rand(0, strlen($chars) - 1)];
53
+            while (strlen($string) < $size) $string .= $chars[rand(0, strlen($chars)-1)];
54 54
         }
55 55
         return $string;
56 56
     }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         if ($size < 14) {
67 67
             $size = 14;
68 68
         }
69
-        $string = $prefix . date('Ymd') . (date('H') + date('i')) . date('s');
69
+        $string = $prefix.date('Ymd').(date('H')+date('i')).date('s');
70 70
         while (strlen($string) < $size) $string .= rand(0, 9);
71 71
         return $string;
72 72
     }
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public function number($size = 12, $prefix = ''): string
81 81
     {
82
-        $time = time() . '';
82
+        $time = time().'';
83 83
         if ($size < 10) {
84 84
             $size = 10;
85 85
         }
86
-        $string = $prefix . ($time[0] . $time[1]) . substr($time, 2) . rand(0, 9);
86
+        $string = $prefix.($time[0].$time[1]).substr($time, 2).rand(0, 9);
87 87
         while (strlen($string) < $size) $string .= rand(0, 9);
88 88
         return $string;
89 89
     }
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,7 +50,9 @@  discard block
 block discarded – undo
50 50
         }
51 51
         $string = $prefix . $chars[rand(1, strlen($chars) - 1)];
52 52
         if (isset($chars)) {
53
-            while (strlen($string) < $size) $string .= $chars[rand(0, strlen($chars) - 1)];
53
+            while (strlen($string) < $size) {
54
+                $string .= $chars[rand(0, strlen($chars) - 1)];
55
+            }
54 56
         }
55 57
         return $string;
56 58
     }
@@ -67,7 +69,9 @@  discard block
 block discarded – undo
67 69
             $size = 14;
68 70
         }
69 71
         $string = $prefix . date('Ymd') . (date('H') + date('i')) . date('s');
70
-        while (strlen($string) < $size) $string .= rand(0, 9);
72
+        while (strlen($string) < $size) {
73
+            $string .= rand(0, 9);
74
+        }
71 75
         return $string;
72 76
     }
73 77
 
@@ -84,7 +88,9 @@  discard block
 block discarded – undo
84 88
             $size = 10;
85 89
         }
86 90
         $string = $prefix . ($time[0] . $time[1]) . substr($time, 2) . rand(0, 9);
87
-        while (strlen($string) < $size) $string .= rand(0, 9);
91
+        while (strlen($string) < $size) {
92
+            $string .= rand(0, 9);
93
+        }
88 94
         return $string;
89 95
     }
90 96
 }
Please login to merge, or discard this patch.
src/helper/Strings.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 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
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      */
38 38
     public function extractBefore(string $str, int $start_num, int $end_num): string
39 39
     {
40
-        if (strlen($str) < $start_num + $end_num) {
40
+        if (strlen($str) < $start_num+$end_num) {
41 41
             return $str;
42 42
         }
43 43
         return substr($str, $start_num, $end_num);
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                 }
152 152
             }
153 153
             return false;
154
-        } else {
154
+        }else {
155 155
             if ($str == $nee) {
156 156
                 return true;
157 157
             }
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/Xmls.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 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
 
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
         $xml = "<xml>";
45 45
         foreach ($values as $key => $val) {
46 46
             if (is_array($val)) {
47
-                $xml .= "<" . $key . ">" . $this->toXml($val) . "</" . $key . ">";
48
-            } else if (is_numeric($val)) {
49
-                $xml .= "<" . $key . ">" . $val . "</" . $key . ">";
50
-            } else {
51
-                $xml .= "<" . $key . "><![CDATA[" . $val . "]]></" . $key . ">";
47
+                $xml .= "<".$key.">".$this->toXml($val)."</".$key.">";
48
+            }else if (is_numeric($val)) {
49
+                $xml .= "<".$key.">".$val."</".$key.">";
50
+            }else {
51
+                $xml .= "<".$key."><![CDATA[".$val."]]></".$key.">";
52 52
             }
53 53
         }
54 54
         $xml .= "</xml>";
Please login to merge, or discard this patch.
src/facade/Randoms.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.
src/facade/Files.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.