Completed
Pull Request — master (#400)
by
unknown
02:34
created
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.
Module.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use mdm\admin\components\Configs;
6 6
 use Yii;
7
-use yii\helpers\Inflector;
8 7
 
9 8
 /**
10 9
  * GUI manager for RBAC.
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     public function getMenus()
120 120
     {
121 121
         if ($this->_normalizeMenus === null) {
122
-            $mid = '/' . $this->getUniqueId() . '/';
122
+            $mid = '/'.$this->getUniqueId().'/';
123 123
             // resolve core menus
124 124
             $this->_normalizeMenus = [];
125 125
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
             foreach ($this->_coreItems as $id => $lable) {
134 134
                 if (!isset($conditions[$id]) || $conditions[$id]) {
135
-                    $this->_normalizeMenus[$id] = ['label' => Yii::t('rbac-admin', $lable), 'url' => [$mid . $id]];
135
+                    $this->_normalizeMenus[$id] = ['label' => Yii::t('rbac-admin', $lable), 'url' => [$mid.$id]];
136 136
                 }
137 137
             }
138 138
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
                 $this->_normalizeMenus[$id] = isset($this->_normalizeMenus[$id]) ? array_merge($this->_normalizeMenus[$id], $value)
149 149
                     : $value;
150 150
                 if (!isset($this->_normalizeMenus[$id]['url'])) {
151
-                    $this->_normalizeMenus[$id]['url'] = [$mid . $id];
151
+                    $this->_normalizeMenus[$id]['url'] = [$mid.$id];
152 152
                 }
153 153
             }
154 154
         }
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 
177 177
             $view->params['breadcrumbs'][] = [
178 178
                 'label' => ($this->defaultUrlLabel ?: Yii::t('rbac-admin', 'Admin')),
179
-                'url' => ['/' . ($this->defaultUrl ?: $this->uniqueId)],
179
+                'url' => ['/'.($this->defaultUrl ?: $this->uniqueId)],
180 180
             ];
181 181
             return true;
182 182
         }
Please login to merge, or discard this patch.
views/layouts/left-menu.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,12 +23,12 @@  discard block
 block discarded – undo
23 23
             <?php
24 24
             foreach ($menus as $menu) {
25 25
                 $r = \mdm\admin\components\Helper::checkRoute($menu['url'][0]);
26
-                if($r) {
27
-                    $label = Html::tag('i', '', ['class' => 'glyphicon glyphicon-chevron-right pull-right']) .
26
+                if ($r) {
27
+                    $label = Html::tag('i', '', ['class' => 'glyphicon glyphicon-chevron-right pull-right']).
28 28
                         Html::tag('span', Html::encode($menu['label']), []);
29 29
                     $active = $menu['active'] ? ' active' : '';
30 30
                     echo Html::a($label, $menu['url'], [
31
-                        'class' => 'list-group-item' . $active,
31
+                        'class' => 'list-group-item'.$active,
32 32
                     ]);
33 33
                 }
34 34
             }
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 </div>
42 42
 <?php
43 43
 list(, $url) = Yii::$app->assetManager->publish('@mdm/admin/assets');
44
-$this->registerCssFile($url . '/list-item.css');
44
+$this->registerCssFile($url.'/list-item.css');
45 45
 ?>
46 46
 
47 47
 <?php $this->endContent(); ?>
Please login to merge, or discard this patch.
models/Assignment.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@
 block discarded – undo
136 136
 
137 137
         $assigned = [];
138 138
         foreach ($manager->getAssignments($this->id) as $item) {
139
-            if(isset($available[$item->roleName])) {
139
+            if (isset($available[$item->roleName])) {
140 140
                 $assigned[$item->roleName] = $available[$item->roleName];
141 141
                 unset($available[$item->roleName]);
142 142
             }
Please login to merge, or discard this patch.