Completed
Pull Request — master (#400)
by
unknown
02:30
created
components/AccessControl.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -69,13 +69,13 @@  discard block
 block discarded – undo
69 69
         $user = $this->getUser();
70 70
 
71 71
         $request = Yii::$app->getRequest();
72
-        if($request->getIsPost()){
72
+        if ($request->getIsPost()) {
73 73
             $params = $request->post();
74
-        }else{
74
+        } else {
75 75
             $params = $request->get();
76 76
         }
77 77
 
78
-        if (Helper::checkRoute('/' . $actionId, $params, $user)) {
78
+        if (Helper::checkRoute('/'.$actionId, $params, $user)) {
79 79
             return true;
80 80
         }
81 81
         $this->denyAccess($user);
@@ -108,15 +108,15 @@  discard block
 block discarded – undo
108 108
         }
109 109
 
110 110
         $user = $this->getUser();
111
-        if($user->getIsGuest())
111
+        if ($user->getIsGuest())
112 112
         {
113 113
             $loginUrl = null;
114
-            if(is_array($user->loginUrl) && isset($user->loginUrl[0])){
114
+            if (is_array($user->loginUrl) && isset($user->loginUrl[0])) {
115 115
                 $loginUrl = $user->loginUrl[0];
116
-                }else if(is_string($user->loginUrl)){
116
+                } else if (is_string($user->loginUrl)) {
117 117
                     $loginUrl = $user->loginUrl;
118 118
                 }
119
-                if(!is_null($loginUrl) && trim($loginUrl,'/') === $uniqueId)
119
+                if (!is_null($loginUrl) && trim($loginUrl, '/') === $uniqueId)
120 120
                 {
121 121
                     return false;
122 122
                 }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
             // convert action uniqueId into an ID relative to the module
127 127
             $mid = $this->owner->getUniqueId();
128 128
             $id = $uniqueId;
129
-            if ($mid !== '' && strpos($id, $mid . '/') === 0) {
129
+            if ($mid !== '' && strpos($id, $mid.'/') === 0) {
130 130
                 $id = substr($id, strlen($mid) + 1);
131 131
             }
132 132
         } else {
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $request = Yii::$app->getRequest();
72 72
         if($request->getIsPost()){
73 73
             $params = $request->post();
74
-        }else{
74
+        } else{
75 75
             $params = $request->get();
76 76
         }
77 77
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
             $loginUrl = null;
114 114
             if(is_array($user->loginUrl) && isset($user->loginUrl[0])){
115 115
                 $loginUrl = $user->loginUrl[0];
116
-                }else if(is_string($user->loginUrl)){
116
+                } else if(is_string($user->loginUrl)){
117 117
                     $loginUrl = $user->loginUrl;
118 118
                 }
119 119
                 if(!is_null($loginUrl) && trim($loginUrl,'/') === $uniqueId)
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.