Completed
Push — master ( f9bacd...4c4c7f )
by Cheren
01:57
created
src/Controller/Admin/GroupsController.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
     /**
38 38
      * Edit action.
39 39
      *
40
-     * @return  mixed
40
+     * @return  \Cake\Http\Response|null
41 41
      *
42 42
      * @throws  RolledbackTransactionException
43 43
      * @throws  \Aura\Intl\Exception
Please login to merge, or discard this patch.
src/Model/Table/UsersTable.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      * @param   array|\ArrayAccess $options The options to use when saving.
74 74
      * @return  \Cake\Datasource\EntityInterface|false
75 75
      */
76
-    public function save(EntityInterface $entity, $options = [])
76
+    public function save(EntityInterface $entity, $options = [ ])
77 77
     {
78 78
         EventManager::trigger('Model.User.beforeSave', $this, [
79 79
             'user' => $entity
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
                 'message'  => __d('community', 'User with this login already exists.')
109 109
             ])
110 110
             ->add('login', 'length', [
111
-                'rule'    => ['minLength', MIN_LENGTH_LOGIN],
111
+                'rule'    => [ 'minLength', MIN_LENGTH_LOGIN ],
112 112
                 'message' => __d('community', 'The minimum login length must be {0} characters', MIN_LENGTH_LOGIN)
113 113
             ]);
114 114
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                 'message'  => __d('community', 'User with this alias already exists.')
122 122
             ])
123 123
             ->add('slug', 'length', [
124
-                'rule'    => ['minLength', MIN_LENGTH_LOGIN],
124
+                'rule'    => [ 'minLength', MIN_LENGTH_LOGIN ],
125 125
                 'message' => __d('community', 'The minimum alias length must be {0} characters', MIN_LENGTH_LOGIN)
126 126
             ]);
127 127
 
@@ -145,14 +145,14 @@  discard block
 block discarded – undo
145 145
         $validator
146 146
             ->notEmpty('password', __d('community', 'Please, enter you password.'))
147 147
             ->add('password', 'minLength', [
148
-                'rule'    => ['minLength', MIN_LENGTH_PASS],
148
+                'rule'    => [ 'minLength', MIN_LENGTH_PASS ],
149 149
                 'message' => __d('community', 'The minimum password length is {0}', MIN_LENGTH_PASS)
150 150
             ]);
151 151
 
152 152
         $validator
153 153
             ->notEmpty('password_confirm', __d('community', 'Please, confirm you password.'))
154 154
             ->add('password_confirm', 'no-misspelling', [
155
-                'rule'    => ['compareWith', 'password'],
155
+                'rule'    => [ 'compareWith', 'password' ],
156 156
                 'message' => __d('community', 'Passwords are not equal')
157 157
             ]);
158 158
 
@@ -169,6 +169,6 @@  discard block
 block discarded – undo
169 169
      */
170 170
     public function findAuth(Query $query, array $options)
171 171
     {
172
-        return $query->where(['Users.status' => 1]);
172
+        return $query->where([ 'Users.status' => 1 ]);
173 173
     }
174 174
 }
Please login to merge, or discard this patch.
src/Controller/UsersController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         }
45 45
 
46 46
         $this
47
-            ->set('user', $this->Users->get($userId, ['contain' => 'Groups']))
47
+            ->set('user', $this->Users->get($userId, [ 'contain' => 'Groups' ]))
48 48
             ->set('page_title', __d('community', 'Edit profile'));
49 49
     }
50 50
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
         if ($user === null) {
65 65
             $this->Flash->error(__d('community', 'User was not found'));
66
-            return $this->redirect(['action' => 'login']);
66
+            return $this->redirect([ 'action' => 'login' ]);
67 67
         }
68 68
 
69 69
         if ($user->status) {
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
             $result = $this->Users->save($user);
81 81
             if ($result) {
82
-                EventManager::trigger('Controller.Users.successActivate', $this, ['user' => $result]);
82
+                EventManager::trigger('Controller.Users.successActivate', $this, [ 'user' => $result ]);
83 83
                 $this->Flash->success(__d(
84 84
                     'community',
85 85
                     '«{0}», you profile has been activate successfully.',
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             }
95 95
         }
96 96
 
97
-        return $this->redirect(['action' => 'login']);
97
+        return $this->redirect([ 'action' => 'login' ]);
98 98
     }
99 99
 
100 100
     /**
@@ -144,10 +144,10 @@  discard block
 block discarded – undo
144 144
 
145 145
         if ($user === null) {
146 146
             $this->Flash->error(__d('community', 'User was not found'));
147
-            return $this->redirect(['action' => 'login']);
147
+            return $this->redirect([ 'action' => 'login' ]);
148 148
         }
149 149
 
150
-        if ($this->request->is(['patch', 'post', 'put'])) {
150
+        if ($this->request->is([ 'patch', 'post', 'put' ])) {
151 151
             $entity = $this->Users->patchEntity($user, $this->request->getData());
152 152
             if ($user->status) {
153 153
                 $entity->set('token', null);
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
                     ]);
171 171
                 }
172 172
 
173
-                return $this->redirect(['action' => 'login']);
173
+                return $this->redirect([ 'action' => 'login' ]);
174 174
             } else {
175 175
                 $this->Flash->error(__d('community', 'An error has occurred. Please, try again.'));
176 176
             }
Please login to merge, or discard this patch.
src/Controller/Component/AuthComponent.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             'flash' => [
72 72
                 'key'       => 'auth',
73 73
                 'element'   => 'error',
74
-                'params'    => ['class' => 'error']
74
+                'params'    => [ 'class' => 'error' ]
75 75
             ],
76 76
             'loginAction' => [
77 77
                 'controller' => 'Users',
@@ -83,16 +83,16 @@  discard block
 block discarded – undo
83 83
                 'controller' => 'Users',
84 84
                 'plugin'     => 'Community'
85 85
             ],
86
-            'authorize'      => ['Community.Base'],
86
+            'authorize'      => [ 'Community.Base' ],
87 87
             'loginRedirect'  => $this->_getLoginRedirect(),
88
-            'logoutRedirect' => $this->_config['loginAction'],
88
+            'logoutRedirect' => $this->_config[ 'loginAction' ],
89 89
             'authError'      => __d('community', 'You are not authorized to access that location.')
90 90
         ];
91 91
 
92 92
         $config = $this->getConfig();
93 93
         foreach ($config as $key => $value) {
94 94
             if ($value !== null) {
95
-                unset($defaults[$key]);
95
+                unset($defaults[ $key ]);
96 96
             }
97 97
         }
98 98
 
Please login to merge, or discard this patch.