Test Failed
Branch master (317681)
by Xu
09:54
created
src/validators/IdCardValidator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -149,11 +149,11 @@
 block discarded – undo
149 149
      */
150 150
     private function getPowerSum($iArr) {
151 151
         $iSum = 0;
152
-        $powerLen = count ( $this->power );
153
-        $arrLen = count ( $iArr );
152
+        $powerLen = count($this->power);
153
+        $arrLen = count($iArr);
154 154
         if ($powerLen == $arrLen) {
155
-            for($i = 0; $i < $arrLen; $i ++) {
156
-                for($j = 0; $j < $powerLen; $j ++) {
155
+            for ($i = 0; $i < $arrLen; $i++) {
156
+                for ($j = 0; $j < $powerLen; $j++) {
157 157
                     if ($i == $j) {
158 158
                         $iSum = $iSum + $iArr [$i] * $this->power [$j];
159 159
                     }
Please login to merge, or discard this patch.
src/console/controllers/TaskController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
      */
88 88
     public function actionDaily()
89 89
     {
90
-        $this->stdout($this->dateTime. " Executing daily tasks." . PHP_EOL, Console::FG_YELLOW);
90
+        $this->stdout($this->dateTime . " Executing daily tasks." . PHP_EOL, Console::FG_YELLOW);
91 91
         $this->trigger(self::EVENT_ON_DAILY_RUN);
92 92
         return ExitCode::OK;
93 93
     }
Please login to merge, or discard this patch.
src/models/Settings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
             'url' => ['value', 'url'],
31 31
             'object' => [
32 32
                 'value',
33
-                function ($attribute) {
33
+                function($attribute) {
34 34
                     $object = null;
35 35
                     try {
36 36
                         Json::decode($this->$attribute);
Please login to merge, or discard this patch.
src/models/User.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -68,13 +68,13 @@  discard block
 block discarded – undo
68 68
     const AFTER_REGISTER = 'afterRegister';
69 69
 
70 70
     //场景定义
71
-    const SCENARIO_CREATE = 'create';//后台或控制台创建用户
72
-    const SCENARIO_UPDATE = 'update';//后台或控制台修改用户
73
-    const SCENARIO_REGISTER = 'basic_create';//邮箱注册
74
-    const SCENARIO_EMAIL_REGISTER = 'email_create';//邮箱注册
75
-    const SCENARIO_MOBILE_REGISTER = 'mobile_create';//手机号注册
76
-    const SCENARIO_SETTINGS = 'settings';//更新
77
-    const SCENARIO_CONNECT = 'connect';//账户链接或自动注册新用户
71
+    const SCENARIO_CREATE = 'create'; //后台或控制台创建用户
72
+    const SCENARIO_UPDATE = 'update'; //后台或控制台修改用户
73
+    const SCENARIO_REGISTER = 'basic_create'; //邮箱注册
74
+    const SCENARIO_EMAIL_REGISTER = 'email_create'; //邮箱注册
75
+    const SCENARIO_MOBILE_REGISTER = 'mobile_create'; //手机号注册
76
+    const SCENARIO_SETTINGS = 'settings'; //更新
77
+    const SCENARIO_CONNECT = 'connect'; //账户链接或自动注册新用户
78 78
     const SCENARIO_PASSWORD = 'password';
79 79
 
80 80
     // following constants are used on secured email changing process
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
             static::SCENARIO_EMAIL_REGISTER => ['nickname', 'email', 'password'],
154 154
             static::SCENARIO_MOBILE_REGISTER => ['mobile', 'password'],
155 155
             static::SCENARIO_SETTINGS => ['username', 'email', 'password'],
156
-            static::SCENARIO_CONNECT => ['nickname', 'email', 'password'],//链接账户密码可以为空邮箱可以为空
157
-            static::SCENARIO_PASSWORD => ['password'],//只修改密码
156
+            static::SCENARIO_CONNECT => ['nickname', 'email', 'password'], //链接账户密码可以为空邮箱可以为空
157
+            static::SCENARIO_PASSWORD => ['password'], //只修改密码
158 158
         ]);
159 159
     }
160 160
 
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
             $this->generateAccessToken();
641 641
             $this->generateAuthKey();
642 642
         }
643
-        if(!empty($this->username)){
643
+        if (!empty($this->username)) {
644 644
             $this->username = $this->generateUsername();
645 645
         }
646 646
         if (!empty($this->password)) {
Please login to merge, or discard this patch.
src/caching/YacCache.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
      */
97 97
     protected function setValues($data, $duration)
98 98
     {
99
-        return $this->yac->set($data,$duration);
99
+        return $this->yac->set($data, $duration);
100 100
     }
101 101
     /**
102 102
      * Stores a value identified by a key into cache if the cache does not contain this key.
Please login to merge, or discard this patch.
src/helpers/StringHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -968,7 +968,7 @@
 block discarded – undo
968 968
     {
969 969
         // Does this string have any 4+ byte Unicode chars?
970 970
         if (max(array_map('ord', str_split($string))) >= 240) {
971
-            $string = preg_replace_callback('/./u', function (array $match) {
971
+            $string = preg_replace_callback('/./u', function(array $match) {
972 972
                 if (strlen($match[0]) >= 4) {
973 973
                     // (Logic pulled from WP's wp_encode_emoji() function)
974 974
                     // UTF-32's hex encoding is the same as HTML's hex encoding.
Please login to merge, or discard this patch.
src/helpers/DateHelper.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -214,7 +214,9 @@  discard block
 block discarded – undo
214 214
                     $i = 0;
215 215
                 } else {
216 216
                     for ($i = 1; $i < 12; $i++) {
217
-                        if ((100 * $month + $day) >= $zone [$i] && (100 * $month + $day) < $zone [$i + 1]) break;
217
+                        if ((100 * $month + $day) >= $zone [$i] && (100 * $month + $day) < $zone [$i + 1]) {
218
+                            break;
219
+                        }
218 220
                     }
219 221
                 }
220 222
                 $result = $data [$i] . '座';
@@ -314,7 +316,9 @@  discard block
 block discarded – undo
314 316
     {
315 317
         $year = $year ? $year : date('Y');
316 318
         $months = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
317
-        if (self::isLeapYear($year)) $months [1] = 29;
319
+        if (self::isLeapYear($year)) {
320
+            $months [1] = 29;
321
+        }
318 322
         return $months;
319 323
     }
320 324
 
Please login to merge, or discard this patch.
src/helpers/ArrayHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
             }
36 36
 
37 37
             // Remove any empty elements and reset the keys
38
-            $object = array_merge(array_filter($object, function ($value) {
38
+            $object = array_merge(array_filter($object, function($value) {
39 39
                 return $value !== '';
40 40
             }));
41 41
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
      */
98 98
     public static function filterEmptyStringsFromArray(array $arr): array
99 99
     {
100
-        return array_filter($arr, function ($value): bool {
100
+        return array_filter($arr, function($value): bool {
101 101
             return $value !== '';
102 102
         });
103 103
     }
Please login to merge, or discard this patch.
migrations/m180223_102826Create_user_profile_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
             'location' => $this->string()->comment('Location'),
31 31
             'address' => $this->string()->comment('Address'),
32 32
             'website' => $this->string()->comment('Website'),
33
-            'timezone' => $this->string(100)->comment('Timezone'),//默认格林威治时间
33
+            'timezone' => $this->string(100)->comment('Timezone'), //默认格林威治时间
34 34
             'birthday' => $this->string(15)->comment('Birthday'),
35 35
             'current' => $this->smallInteger(1)->comment('Current'),
36 36
             'qq' => $this->string(11)->comment('QQ'),
Please login to merge, or discard this patch.