Skip to content

Commit 184b0f5

Browse files
committed
Fix CS issues after new rule added to CakePHP rule set
1 parent 9e21a37 commit 184b0f5

40 files changed

+157
-157
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/PasswordManagementTrait.php

Lines changed: 5 additions & 5 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

@@ -70,7 +70,7 @@ public function changePassword($id = null)
7070
} else {
7171
// password reset
7272
$user->id = $this->getRequest()->getSession()->read(
73-
Configure::read('Users.Key.Session.resetPasswordUserId')
73+
Configure::read('Users.Key.Session.resetPasswordUserId'),
7474
);
7575
$validatePassword = false;
7676
$redirect = $this->Authentication->getConfig('loginAction');
@@ -99,7 +99,7 @@ public function changePassword($id = null)
9999
'password' => true,
100100
'password_confirm' => true,
101101
],
102-
]
102+
],
103103
);
104104

105105
if ($user->getErrors()) {
@@ -168,7 +168,7 @@ public function requestResetPassword()
168168
if ($resetUser) {
169169
$msg = __d(
170170
'cake_d_c/users',
171-
'If the account is valid, the system will send an instructional email to the address on record.'
171+
'If the account is valid, the system will send an instructional email to the address on record.',
172172
);
173173
$this->Flash->success($msg);
174174
} else {
@@ -180,7 +180,7 @@ public function requestResetPassword()
180180
} catch (UserNotFoundException | UserNotActiveException $exception) {
181181
$msg = __d(
182182
'cake_d_c/users',
183-
'If the account is valid, the system will send an instructional email to the address on record.'
183+
'If the account is valid, the system will send an instructional email to the address on record.',
184184
);
185185
$this->Flash->success($msg);
186186
} 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([

src/Controller/UsersController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function initialize(): void
6464
'webauthn2faRegisterOptions',
6565
'webauthn2faAuthenticate',
6666
'webauthn2faAuthenticateOptions',
67-
]
67+
],
6868
);
6969
}
7070
}

0 commit comments

Comments
 (0)