Passed
Pull Request — master (#19)
by
unknown
01:51
created
app/Console/FreeNom.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
             ],
133 133
             'cookies' => $this->jar
134 134
         ]);
135
-        $body = (string)$response->getBody();
135
+        $body = (string) $response->getBody();
136 136
 
137 137
         // 域名数据
138 138
         if (!preg_match_all(self::DOMAIN_INFO_REGEX, $body, $domains, PREG_SET_ORDER)) {
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         if (!preg_match(self::TOKEN_REGEX, $body, $matches)) {
144 144
             throw new LlfException(32520004);
145 145
         }
146
-        $token = $matches['token'];
146
+        $token = $matches[ 'token' ];
147 147
 
148 148
         // 续期
149 149
         $result = '';
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
         $notRenewed = $notRenewedTG = ''; // 记录续期出错的域名,用于邮件通知内容
152 152
         $domainInfo = $domainInfoTG = ''; // 域名状态信息,用于邮件通知内容
153 153
         foreach ($domains as $d) {
154
-            $domain = $d['domain'];
155
-            $days = intval($d['days']);
156
-            $id = $d['id'];
154
+            $domain = $d[ 'domain' ];
155
+            $days = intval($d[ 'days' ]);
156
+            $id = $d[ 'id' ];
157 157
 
158 158
             // 免费域名只允许在到期前14天内续期
159 159
             if ($days <= 14) {
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
                     continue;
177 177
                 }
178 178
 
179
-                $body = (string)$response->getBody();
179
+                $body = (string) $response->getBody();
180 180
                 sleep(1);
181 181
 
182 182
                 if (stripos($body, 'Order Confirmation') === false) { // 续期失败
@@ -238,27 +238,27 @@  discard block
 block discarded – undo
238 238
      *
239 239
      * @return bool
240 240
      */
241
-    public function arrayUnique(array &$array, array $keys = [])
241
+    public function arrayUnique(array &$array, array $keys = [ ])
242 242
     {
243
-        if (!isset($array[0]) || !is_array($array[0])) {
243
+        if (!isset($array[ 0 ]) || !is_array($array[ 0 ])) {
244 244
             return false;
245 245
         }
246 246
 
247 247
         if (empty($keys)) {
248
-            $keys = array_keys($array[0]);
248
+            $keys = array_keys($array[ 0 ]);
249 249
         }
250 250
 
251
-        $tmp = [];
251
+        $tmp = [ ];
252 252
         foreach ($array as $k => $items) {
253 253
             $combinedKey = '';
254 254
             foreach ($keys as $key) {
255
-                $combinedKey .= $items[$key];
255
+                $combinedKey .= $items[ $key ];
256 256
             }
257 257
 
258
-            if (isset($tmp[$combinedKey])) {
259
-                unset($array[$k]);
258
+            if (isset($tmp[ $combinedKey ])) {
259
+                unset($array[ $k ]);
260 260
             } else {
261
-                $tmp[$combinedKey] = $k;
261
+                $tmp[ $combinedKey ] = $k;
262 262
             }
263 263
         }
264 264
         unset($tmp);
@@ -274,15 +274,15 @@  discard block
 block discarded – undo
274 274
      */
275 275
     protected function getAccounts()
276 276
     {
277
-        $accounts = [];
277
+        $accounts = [ ];
278 278
         $multipleAccounts = preg_replace('/\s/', '', env('MULTIPLE_ACCOUNTS'));
279 279
         if ($multipleAccounts) {
280 280
             if (preg_match_all('/<(?P<u>.*?)>@<(?P<p>.*?)>/i', $multipleAccounts, $matches, PREG_SET_ORDER)) {
281 281
                 foreach ($matches as $m) {
282 282
                     system_log($m);
283
-                    $accounts[] = [
284
-                        'username' => $m['u'],
285
-                        'password' => $m['p']
283
+                    $accounts[ ] = [
284
+                        'username' => $m[ 'u' ],
285
+                        'password' => $m[ 'p' ]
286 286
                     ];
287 287
                 }
288 288
             }
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
             $username = env('FREENOM_USERNAME');
292 292
             $password = env('FREENOM_PASSWORD');
293 293
             if ($username && $password) {
294
-                $accounts[] = [
294
+                $accounts[ ] = [
295 295
                     'username' => $username,
296 296
                     'password' => $password
297 297
                 ];
@@ -317,8 +317,8 @@  discard block
 block discarded – undo
317 317
         $accounts = $this->getAccounts();
318 318
         foreach ($accounts as $account) {
319 319
             try {
320
-                $this->username = $account['username'];
321
-                $this->password = $account['password'];
320
+                $this->username = $account[ 'username' ];
321
+                $this->password = $account[ 'password' ];
322 322
                 $this->renewDomains();
323 323
             } catch (LlfException $e) {
324 324
                 Mail::send(
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -286,8 +286,7 @@
 block discarded – undo
286 286
                     ];
287 287
                 }
288 288
             }
289
-        } 
290
-        else {
289
+        } else {
291 290
             $username = env('FREENOM_USERNAME');
292 291
             $password = env('FREENOM_PASSWORD');
293 292
             if ($username && $password) {
Please login to merge, or discard this patch.