Skip to content

Commit dbc1285

Browse files
committed
Fix CS issues after new rule added to CakePHP rule set
1 parent 898d784 commit dbc1285

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+160
-160
lines changed

src/Authenticator/SocialPendingEmailAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function _buildLoginUrlErrorResult($request)
6767
sprintf(
6868
'Login URL `%s` did not match `%s`.',
6969
(string)$request->getUri(),
70-
implode('` or `', (array)$this->getConfig('loginUrl'))
70+
implode('` or `', (array)$this->getConfig('loginUrl')),
7171
),
7272
];
7373

src/Command/UsersPasswordEmailCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ public function execute(Arguments $args, ConsoleIo $io)
5454
if ($resetUser) {
5555
$msg = __d(
5656
'cake_d_c/users',
57-
'Please ask the user to check the email to continue with password reset process'
57+
'Please ask the user to check the email to continue with password reset process',
5858
);
5959
$io->out($msg);
6060
} else {
6161
$msg = __d(
6262
'cake_d_c/users',
63-
'The password token could not be generated. Please try again'
63+
'The password token could not be generated. Please try again',
6464
);
6565
$io->abort($msg);
6666
}

src/Controller/Component/LoginComponent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ protected function afterIdentifyUser($user)
165165
$userId = $user['id'] ?? null;
166166
Log::info(
167167
"Unsafe redirect `$queryRedirect` ignored, user id `{$userId}` " .
168-
"redirected to `$redirectUrl` after successful login"
168+
"redirected to `$redirectUrl` after successful login",
169169
);
170170
$queryRedirect = $redirectUrl;
171171
}
@@ -243,7 +243,7 @@ protected function updateLastLogin($user)
243243
$user->set($field, $now);
244244
$this->getController()->getUsersTable()->updateAll(
245245
[$field => $now->format('Y-m-d H:i:s')],
246-
['id' => $user->id]
246+
['id' => $user->id],
247247
);
248248
}
249249

src/Controller/Traits/LinkSocialTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function callbackLinkSocial($alias = null)
8383
$log = sprintf(
8484
'Error linking social account: %s %s',
8585
$e->getMessage(),
86-
$e
86+
$e,
8787
);
8888
$this->log($log);
8989

src/Controller/Traits/OneTimePasswordVerifyTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ public function verify()
3434
Configure::read('Auth.AuthenticationComponent.loginAction'),
3535
[
3636
'?' => $this->getRequest()->getQueryParams(),
37-
]
37+
],
3838
);
3939
if (!$this->isVerifyAllowed()) {
4040
return $this->redirect($loginAction);
4141
}
4242

4343
$temporarySession = $this->getRequest()->getSession()->read(
44-
AuthenticationService::TWO_FACTOR_VERIFY_SESSION_KEY
44+
AuthenticationService::TWO_FACTOR_VERIFY_SESSION_KEY,
4545
);
4646
$secretVerified = $temporarySession['secret_verified'] ?? null;
4747
// showing QR-code until shared secret is verified
@@ -53,7 +53,7 @@ public function verify()
5353

5454
$secretDataUri = $this->OneTimePasswordAuthenticator->getQRCodeImageAsDataUri(
5555
$temporarySession['email'],
56-
$secret
56+
$secret,
5757
);
5858
$this->set(['secretDataUri' => $secretDataUri]);
5959
}
@@ -83,7 +83,7 @@ protected function isVerifyAllowed()
8383
}
8484

8585
$temporarySession = $this->getRequest()->getSession()->read(
86-
AuthenticationService::TWO_FACTOR_VERIFY_SESSION_KEY
86+
AuthenticationService::TWO_FACTOR_VERIFY_SESSION_KEY,
8787
);
8888

8989
if (empty($temporarySession) || !isset($temporarySession['id'])) {

src/Controller/Traits/OneTimeTokenTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ public function requestLoginLink()
3939
$Users->sendLoginLink($email);
4040
} catch (RecordNotFoundException $e) {
4141
$this->log(
42-
sprintf('A user is trying to get a login link for the email %s but it does not exist.', $email)
42+
sprintf('A user is trying to get a login link for the email %s but it does not exist.', $email),
4343
);
4444
}
4545
$msg = __d(
4646
'cake_d_c/users',
4747
'If your user is registered in the system you will receive an email ' .
48-
'with a link so you can access your user area.'
48+
'with a link so you can access your user area.',
4949
);
5050
$this->Flash->success($msg);
5151
$this->setRequest($this->getRequest()->withoutData('email'));

src/Controller/Traits/PasswordManagementTrait.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function changePassword($id = null)
6161
$redirect = Configure::read('Users.Profile.route');
6262
} else {
6363
$this->Flash->error(
64-
__d('cake_d_c/users', 'Changing another user\'s password is not allowed')
64+
__d('cake_d_c/users', 'Changing another user\'s password is not allowed'),
6565
);
6666
$this->redirect(Configure::read('Users.Profile.route'));
6767

@@ -72,8 +72,8 @@ public function changePassword($id = null)
7272
$user->set(
7373
'id',
7474
$this->getRequest()->getSession()->read(
75-
Configure::read('Users.Key.Session.resetPasswordUserId')
76-
)
75+
Configure::read('Users.Key.Session.resetPasswordUserId'),
76+
),
7777
);
7878
$validatePassword = false;
7979
$redirect = $this->Authentication->getConfig('loginAction');
@@ -102,7 +102,7 @@ public function changePassword($id = null)
102102
'password' => true,
103103
'password_confirm' => true,
104104
],
105-
]
105+
],
106106
);
107107

108108
if ($user->getErrors()) {
@@ -171,7 +171,7 @@ public function requestResetPassword()
171171
if ($resetUser) {
172172
$msg = __d(
173173
'cake_d_c/users',
174-
'If the account is valid, the system will send an instructional email to the address on record.'
174+
'If the account is valid, the system will send an instructional email to the address on record.',
175175
);
176176
$this->Flash->success($msg);
177177
} else {
@@ -183,7 +183,7 @@ public function requestResetPassword()
183183
} catch (UserNotFoundException | UserNotActiveException $exception) {
184184
$msg = __d(
185185
'cake_d_c/users',
186-
'If the account is valid, the system will send an instructional email to the address on record.'
186+
'If the account is valid, the system will send an instructional email to the address on record.',
187187
);
188188
$this->Flash->success($msg);
189189
} catch (Exception $exception) {

src/Controller/Traits/RegisterTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ protected function _validateRegisterPost()
135135

136136
return $this->validateReCaptcha(
137137
$this->getRequest()->getData('g-recaptcha-response'),
138-
$this->getRequest()->clientIp()
138+
$this->getRequest()->clientIp(),
139139
);
140140
}
141141

src/Controller/Traits/UserValidationTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function validate($type = null, $token = null)
4545
if ($result) {
4646
$event = $this->dispatchEvent(
4747
Plugin::EVENT_AFTER_EMAIL_TOKEN_VALIDATION,
48-
['user' => $result]
48+
['user' => $result],
4949
);
5050
$eventResult = $event->getResult();
5151
if (!empty($eventResult) && is_array($eventResult)) {
@@ -65,7 +65,7 @@ public function validate($type = null, $token = null)
6565
$this->Flash->success(__d('cake_d_c/users', 'Reset password token was validated successfully'));
6666
$this->getRequest()->getSession()->write(
6767
Configure::read('Users.Key.Session.resetPasswordUserId'),
68-
$result->id
68+
$result->id,
6969
);
7070

7171
return $this->redirect(['action' => 'changePassword']);
@@ -119,7 +119,7 @@ public function resendTokenValidation()
119119
}
120120
$this->Flash->success(__d(
121121
'cake_d_c/users',
122-
'Token has been reset successfully. Please check your email.'
122+
'Token has been reset successfully. Please check your email.',
123123
));
124124
} else {
125125
$this->Flash->error(__d('cake_d_c/users', 'Token could not be reset'));

src/Controller/Traits/Webauthn2faTrait.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function webauthn2faRegisterOptions(?RegisterAdapter $adapter = null)
5252
}
5353

5454
throw new BadRequestException(
55-
__d('cake_d_c/users', 'User already has configured webauthn2fa')
55+
__d('cake_d_c/users', 'User already has configured webauthn2fa'),
5656
);
5757
}
5858

@@ -73,7 +73,7 @@ public function webauthn2faRegister(?RegisterAdapter $adapter = null): \Cake\Htt
7373
return $this->getResponse()->withStringBody(json_encode(['success' => true]));
7474
}
7575
throw new BadRequestException(
76-
__d('cake_d_c/users', 'User already has configured webauthn2fa')
76+
__d('cake_d_c/users', 'User already has configured webauthn2fa'),
7777
);
7878
} catch (\Throwable $e) {
7979
$user = $this->request->getSession()->read('Webauthn2fa.User');
@@ -93,7 +93,7 @@ public function webauthn2faAuthenticateOptions(?AuthenticateAdapter $adapter = n
9393
$adapter = $adapter ?? $this->getWebauthn2faAuthenticateAdapter();
9494

9595
return $this->getResponse()->withStringBody(
96-
json_encode($adapter->getOptions())
96+
json_encode($adapter->getOptions()),
9797
);
9898
}
9999

@@ -115,7 +115,7 @@ public function webauthn2faAuthenticate(?AuthenticateAdapter $adapter = null): \
115115
$this->getRequest()->getSession()->delete('Webauthn2fa');
116116
$this->getRequest()->getSession()->write(
117117
TwoFactorAuthenticator::USER_SESSION_KEY,
118-
$adapter->getUser()
118+
$adapter->getUser(),
119119
);
120120

121121
return $this->getResponse()->withStringBody(json_encode([

0 commit comments

Comments
 (0)