Passed
Pull Request — master (#449)
by
unknown
02:48
created
models/searchs/AuthItem.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -64,13 +64,13 @@
 block discarded – undo
64 64
             $items = $authManager->getRoles();
65 65
         } else {
66 66
             $items = array_filter($authManager->getPermissions(), function($item) use ($advanced){
67
-              $isPermission = $this->type == Item::TYPE_PERMISSION;
68
-              if ($advanced) {
67
+                $isPermission = $this->type == Item::TYPE_PERMISSION;
68
+                if ($advanced) {
69 69
                 return $isPermission xor (strncmp($item->name, '/', 1) === 0 or strncmp($item->name, '@', 1) === 0);
70
-              }
71
-              else {
70
+                }
71
+                else {
72 72
                 return $isPermission xor strncmp($item->name, '/', 1) === 0;
73
-              }
73
+                }
74 74
             });
75 75
         }
76 76
         $this->load($params);
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,8 +67,7 @@
 block discarded – undo
67 67
               $isPermission = $this->type == Item::TYPE_PERMISSION;
68 68
               if ($advanced) {
69 69
                 return $isPermission xor (strncmp($item->name, '/', 1) === 0 or strncmp($item->name, '@', 1) === 0);
70
-              }
71
-              else {
70
+              } else {
72 71
                 return $isPermission xor strncmp($item->name, '/', 1) === 0;
73 72
               }
74 73
             });
Please login to merge, or discard this patch.
models/form/Login.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
     public function getUser()
72 72
     {
73 73
         if ($this->_user === false) {
74
-            $class = Yii::$app->getUser()->identityClass ? : 'mdm\admin\models\User';
74
+            $class = Yii::$app->getUser()->identityClass ?: 'mdm\admin\models\User';
75 75
             $this->_user = $class::findByUsername($this->username);
76 76
         }
77 77
 
Please login to merge, or discard this patch.
models/form/ResetPassword.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
         }
87 87
         $expire = ArrayHelper::getValue(Yii::$app->params, 'user.passwordResetTokenExpire', 24 * 3600);
88 88
         $parts = explode('_', $token);
89
-        $timestamp = (int) end($parts);
89
+        $timestamp = (int)end($parts);
90 90
         return $timestamp + $expire >= time();
91 91
     }
92 92
 }
Please login to merge, or discard this patch.
models/form/Signup.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      */
23 23
     public function rules()
24 24
     {
25
-        $class = Yii::$app->getUser()->identityClass ? : 'mdm\admin\models\User';
25
+        $class = Yii::$app->getUser()->identityClass ?: 'mdm\admin\models\User';
26 26
         return [
27 27
             ['username', 'filter', 'filter' => 'trim'],
28 28
             ['username', 'required'],
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     public function signup()
51 51
     {
52 52
         if ($this->validate()) {
53
-            $class = Yii::$app->getUser()->identityClass ? : 'mdm\admin\models\User';
53
+            $class = Yii::$app->getUser()->identityClass ?: 'mdm\admin\models\User';
54 54
             $user = new $class();
55 55
             $user->username = $this->username;
56 56
             $user->email = $this->email;
Please login to merge, or discard this patch.
models/form/PasswordResetRequest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
      */
19 19
     public function rules()
20 20
     {
21
-        $class = Yii::$app->getUser()->identityClass ? : 'mdm\admin\models\User';
21
+        $class = Yii::$app->getUser()->identityClass ?: 'mdm\admin\models\User';
22 22
         return [
23 23
             ['email', 'filter', 'filter' => 'trim'],
24 24
             ['email', 'required'],
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     public function sendEmail()
40 40
     {
41 41
         /* @var $user User */
42
-        $class = Yii::$app->getUser()->identityClass ? : 'mdm\admin\models\User';
42
+        $class = Yii::$app->getUser()->identityClass ?: 'mdm\admin\models\User';
43 43
         $user = $class::findOne([
44 44
             'status' => UserStatus::ACTIVE,
45 45
             'email' => $this->email,
@@ -47,14 +47,14 @@  discard block
 block discarded – undo
47 47
 
48 48
         if ($user) {
49 49
             if (!ResetPassword::isPasswordResetTokenValid($user->password_reset_token)) {
50
-                $user->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();
50
+                $user->password_reset_token = Yii::$app->security->generateRandomString().'_'.time();
51 51
             }
52 52
 
53 53
             if ($user->save()) {
54 54
                 return Yii::$app->mailer->compose(['html' => 'passwordResetToken-html', 'text' => 'passwordResetToken-text'], ['user' => $user])
55
-                    ->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name . ' robot'])
55
+                    ->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name.' robot'])
56 56
                     ->setTo($this->email)
57
-                    ->setSubject('Password reset for ' . Yii::$app->name)
57
+                    ->setSubject('Password reset for '.Yii::$app->name)
58 58
                     ->send();
59 59
             }
60 60
         }
Please login to merge, or discard this patch.
models/searchs/User.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     public function rules()
23 23
     {
24 24
         return [
25
-            [['id', 'status',], 'integer'],
25
+            [['id', 'status', ], 'integer'],
26 26
             [['username', 'email'], 'safe'],
27 27
         ];
28 28
     }
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     public function search($params)
38 38
     {
39 39
         /* @var $query \yii\db\ActiveQuery */
40
-        $class = Yii::$app->getUser()->identityClass ? : 'mdm\admin\models\User';
40
+        $class = Yii::$app->getUser()->identityClass ?: 'mdm\admin\models\User';
41 41
         $query = $class::find();
42 42
 
43 43
         $dataProvider = new ActiveDataProvider([
Please login to merge, or discard this patch.
controllers/DefaultController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
      */
19 19
     public function actionIndex($page = 'README.md')
20 20
     {
21
-        if (preg_match('/^docs\/images\/image\d+\.png$/',$page)) {
21
+        if (preg_match('/^docs\/images\/image\d+\.png$/', $page)) {
22 22
             $file = Yii::getAlias("@mdm/admin/{$page}");
23 23
             return Yii::$app->getResponse()->sendFile($file);
24 24
         }
Please login to merge, or discard this patch.
views/default/index.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
     $baseDir = '';
11 11
     $this->title = substr($page, 0, strrpos($page, '.'));
12 12
 } else {
13
-    $baseDir = substr($page, 0, $pos) . '/';
13
+    $baseDir = substr($page, 0, $pos).'/';
14 14
     $this->title = substr($page, $pos + 1, strrpos($page, '.') - $pos - 1);
15 15
 }
16 16
 
@@ -22,10 +22,10 @@  discard block
 block discarded – undo
22 22
         $url = Url::to($menu['url'], true);
23 23
         $links[] = "[**{$menu['label']}**]({$url})";
24 24
     }
25
-    $body = str_replace(':smile:.', ".\n\n" . implode('  ', $links) . "\n", file_get_contents(Url::to('@mdm/admin/'.$page)));
26
-} elseif(preg_match('/^docs\/guide\/[\w-]+\.md$/', $page)) {
25
+    $body = str_replace(':smile:.', ".\n\n".implode('  ', $links)."\n", file_get_contents(Url::to('@mdm/admin/'.$page)));
26
+} elseif (preg_match('/^docs\/guide\/[\w-]+\.md$/', $page)) {
27 27
     $body = file_get_contents(Url::to("@mdm/admin/{$page}"));
28
-} else{
28
+} else {
29 29
     $body = '';
30 30
 }
31 31
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         if ($link[0] == '/') {
36 36
             $link = Url::current(['page' => ltrim($link, '/')], true);
37 37
         } else {
38
-            $link = Url::current(['page' => $baseDir . $link], true);
38
+            $link = Url::current(['page' => $baseDir.$link], true);
39 39
         }
40 40
     }
41 41
     return "]($link)";
Please login to merge, or discard this patch.