Passed
Push — master ( f33495...006602 )
by luo
01:42
created
libs/Log.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      * @return bool
56 56
      * @throws \Exception
57 57
      */
58
-    public static function debug($message, array $context = [])
58
+    public static function debug($message, array $context = [ ])
59 59
     {
60 60
         return self::logger()->addDebug($message, $context);
61 61
     }
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      * @return bool
68 68
      * @throws \Exception
69 69
      */
70
-    public static function info($message, array $context = [])
70
+    public static function info($message, array $context = [ ])
71 71
     {
72 72
         return self::logger()->addInfo($message, $context);
73 73
     }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      * @return bool
80 80
      * @throws \Exception
81 81
      */
82
-    public static function notice($message, array $context = [])
82
+    public static function notice($message, array $context = [ ])
83 83
     {
84 84
         return self::logger()->addNotice($message, $context);
85 85
     }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      * @return bool
92 92
      * @throws \Exception
93 93
      */
94
-    public static function warning($message, array $context = [])
94
+    public static function warning($message, array $context = [ ])
95 95
     {
96 96
         return self::logger()->addWarning($message, $context);
97 97
     }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
      * @return bool
104 104
      * @throws \Exception
105 105
      */
106
-    public static function error($message, array $context = [])
106
+    public static function error($message, array $context = [ ])
107 107
     {
108 108
         return self::logger()->addError($message, $context);
109 109
     }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
      * @return bool
116 116
      * @throws \Exception
117 117
      */
118
-    public static function alert($message, array $context = [])
118
+    public static function alert($message, array $context = [ ])
119 119
     {
120 120
         return self::logger()->addAlert($message, $context);
121 121
     }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
      * @return bool
128 128
      * @throws \Exception
129 129
      */
130
-    public static function emergency($message, array $context = [])
130
+    public static function emergency($message, array $context = [ ])
131 131
     {
132 132
         return self::logger()->addEmergency($message, $context);
133 133
     }
Please login to merge, or discard this patch.
libs/Lang.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,17 +40,17 @@
 block discarded – undo
40 40
                 $keys = explode('.', $key);
41 41
                 $val = $lang;
42 42
                 foreach ($keys as $k) {
43
-                    if (!isset($val[$k])) {
43
+                    if (!isset($val[ $k ])) {
44 44
                         return null; // 任一下标不存在就返回null
45 45
                     }
46 46
 
47
-                    $val = $val[$k];
47
+                    $val = $val[ $k ];
48 48
                 }
49 49
 
50 50
                 return $val;
51 51
             } else {
52
-                if (isset($lang[$key])) {
53
-                    return $lang[$key];
52
+                if (isset($lang[ $key ])) {
53
+                    return $lang[ $key ];
54 54
                 }
55 55
 
56 56
                 return null;
Please login to merge, or discard this patch.
libs/Env.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
                 return null;
64 64
         }
65 65
 
66
-        if (($valueLength = strlen($value)) > 1 && $value[0] === '"' && $value[$valueLength - 1] === '"') { // 去除双引号
66
+        if (($valueLength = strlen($value)) > 1 && $value[ 0 ] === '"' && $value[ $valueLength - 1 ] === '"') { // 去除双引号
67 67
             return substr($value, 1, -1);
68 68
         }
69 69
 
Please login to merge, or discard this patch.
libs/Config.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,17 +43,17 @@
 block discarded – undo
43 43
                 $keys = explode('.', $key);
44 44
                 $val = $allConfig;
45 45
                 foreach ($keys as $k) {
46
-                    if (!isset($val[$k])) {
46
+                    if (!isset($val[ $k ])) {
47 47
                         return $default; // 任一下标不存在就返回默认值
48 48
                     }
49 49
 
50
-                    $val = $val[$k];
50
+                    $val = $val[ $k ];
51 51
                 }
52 52
 
53 53
                 return $val;
54 54
             } else {
55
-                if (isset($allConfig[$key])) {
56
-                    return $allConfig[$key];
55
+                if (isset($allConfig[ $key ])) {
56
+                    return $allConfig[ $key ];
57 57
                 }
58 58
 
59 59
                 return $default;
Please login to merge, or discard this patch.
app/helpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
      * 'bg_green', 'bg_yellow', 'bg_blue', 'bg_magenta', 'bg_cyan', 'bg_light_gray', 'bg_dark_gray', 'bg_light_red',
58 58
      * 'bg_light_green','bg_light_yellow', 'bg_light_blue', 'bg_light_magenta', 'bg_light_cyan', 'bg_white'
59 59
      */
60
-    function system_log($content, array $response = [], $fileName = '')
60
+    function system_log($content, array $response = [ ], $fileName = '')
61 61
     {
62 62
         try {
63 63
             $path = sprintf('%s/logs/%s/', ROOT_PATH, date('Y-m'));
Please login to merge, or discard this patch.
libs/TelegramBot.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -117,8 +117,8 @@
 block discarded – undo
117 117
                 ],
118 118
             ]
119 119
         );
120
-        $rp = json_decode((string)$response->getBody(), true);
120
+        $rp = json_decode((string) $response->getBody(), true);
121 121
 
122
-        return $rp['ok'] ?? false;
122
+        return $rp[ 'ok' ] ?? false;
123 123
     }
124 124
 }
125 125
\ No newline at end of file
Please login to merge, or discard this patch.
libs/Argv.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     /**
20 20
      * @var array 所有命令行传参
21 21
      */
22
-    public $allArgvs = [];
22
+    public $allArgvs = [ ];
23 23
 
24 24
     public function __construct()
25 25
     {
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             $this->setAllArgvs();
67 67
         }
68 68
 
69
-        return $this->allArgvs[$name] ?? $default;
69
+        return $this->allArgvs[ $name ] ?? $default;
70 70
     }
71 71
 
72 72
     /**
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
         foreach ($argv as $a) { // Windows默认命令行无法正确传入使用引号括住的带空格参数,换个命令行终端就好,Linux不受影响
82 82
             if (preg_match('/^-{1,2}(?P<name>\w+)(?:=([\'"]|)(?P<val>[^\n\t\v\f\r\'"]+)\2)?$/i', $a, $m)) {
83
-                $this->allArgvs[$m['name']] = $m['val'] ?? true;
83
+                $this->allArgvs[ $m[ 'name' ] ] = $m[ 'val' ] ?? true;
84 84
             }
85 85
         }
86 86
 
Please login to merge, or discard this patch.
app/Console/FreeNom.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
             ],
136 136
             'cookies' => $this->jar
137 137
         ]);
138
-        $body = (string)$response->getBody();
138
+        $body = (string) $response->getBody();
139 139
 
140 140
         if (!preg_match(self::LOGIN_STATUS_REGEX, $body)) {
141 141
             throw new LlfException(34520009);
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
         if (!preg_match(self::TOKEN_REGEX, $body, $matches)) {
151 151
             throw new LlfException(34520004);
152 152
         }
153
-        $token = $matches['token'];
153
+        $token = $matches[ 'token' ];
154 154
 
155 155
         // 续期
156 156
         $result = '';
@@ -158,9 +158,9 @@  discard block
 block discarded – undo
158 158
         $notRenewed = $notRenewedTG = ''; // 记录续期出错的域名,用于邮件通知内容
159 159
         $domainInfo = $domainInfoTG = ''; // 域名状态信息,用于邮件通知内容
160 160
         foreach ($domains as $d) {
161
-            $domain = $d['domain'];
162
-            $days = intval($d['days']);
163
-            $id = $d['id'];
161
+            $domain = $d[ 'domain' ];
162
+            $days = intval($d[ 'days' ]);
163
+            $id = $d[ 'id' ];
164 164
 
165 165
             // 免费域名只允许在到期前14天内续期
166 166
             if ($days <= 14) {
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
                     continue;
184 184
                 }
185 185
 
186
-                $body = (string)$response->getBody();
186
+                $body = (string) $response->getBody();
187 187
                 sleep(1);
188 188
 
189 189
                 if (stripos($body, 'Order Confirmation') === false) { // 续期失败
@@ -245,27 +245,27 @@  discard block
 block discarded – undo
245 245
      *
246 246
      * @return bool
247 247
      */
248
-    public function arrayUnique(array &$array, array $keys = [])
248
+    public function arrayUnique(array &$array, array $keys = [ ])
249 249
     {
250
-        if (!isset($array[0]) || !is_array($array[0])) {
250
+        if (!isset($array[ 0 ]) || !is_array($array[ 0 ])) {
251 251
             return false;
252 252
         }
253 253
 
254 254
         if (empty($keys)) {
255
-            $keys = array_keys($array[0]);
255
+            $keys = array_keys($array[ 0 ]);
256 256
         }
257 257
 
258
-        $tmp = [];
258
+        $tmp = [ ];
259 259
         foreach ($array as $k => $items) {
260 260
             $combinedKey = '';
261 261
             foreach ($keys as $key) {
262
-                $combinedKey .= $items[$key];
262
+                $combinedKey .= $items[ $key ];
263 263
             }
264 264
 
265
-            if (isset($tmp[$combinedKey])) {
266
-                unset($array[$k]);
265
+            if (isset($tmp[ $combinedKey ])) {
266
+                unset($array[ $k ]);
267 267
             } else {
268
-                $tmp[$combinedKey] = $k;
268
+                $tmp[ $combinedKey ] = $k;
269 269
             }
270 270
         }
271 271
         unset($tmp);
@@ -281,13 +281,13 @@  discard block
 block discarded – undo
281 281
      */
282 282
     protected function getAccounts()
283 283
     {
284
-        $accounts = [];
284
+        $accounts = [ ];
285 285
         $multipleAccounts = preg_replace('/\s/', '', env('MULTIPLE_ACCOUNTS'));
286 286
         if (preg_match_all('/<(?P<u>.*?)>@<(?P<p>.*?)>/i', $multipleAccounts, $matches, PREG_SET_ORDER)) {
287 287
             foreach ($matches as $m) {
288
-                $accounts[] = [
289
-                    'username' => $m['u'],
290
-                    'password' => $m['p']
288
+                $accounts[ ] = [
289
+                    'username' => $m[ 'u' ],
290
+                    'password' => $m[ 'p' ]
291 291
                 ];
292 292
             }
293 293
         }
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
         $username = env('FREENOM_USERNAME');
296 296
         $password = env('FREENOM_PASSWORD');
297 297
         if ($username && $password) {
298
-            $accounts[] = [
298
+            $accounts[ ] = [
299 299
                 'username' => $username,
300 300
                 'password' => $password
301 301
             ];
@@ -320,8 +320,8 @@  discard block
 block discarded – undo
320 320
         $accounts = $this->getAccounts();
321 321
         foreach ($accounts as $account) {
322 322
             try {
323
-                $this->username = $account['username'];
324
-                $this->password = $account['password'];
323
+                $this->username = $account[ 'username' ];
324
+                $this->password = $account[ 'password' ];
325 325
                 $this->renewDomains();
326 326
             } catch (LlfException $e) {
327 327
                 Mail::send(
Please login to merge, or discard this patch.
libs/Mail.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -126,6 +126,8 @@
 block discarded – undo
126 126
 
127 127
         self::mail()->msgHTML($message, APP_PATH . '/mail');
128 128
 
129
-        if (!self::mail()->send()) throw new MailException(self::mail()->ErrorInfo);
129
+        if (!self::mail()->send()) {
130
+            throw new MailException(self::mail()->ErrorInfo);
131
+        }
130 132
     }
131 133
 }
Please login to merge, or discard this patch.