Skip to content

Commit 6249660

Browse files
authored
Merge pull request #697 from cakephp/fix-cs
Update to latest codesniffer rules
2 parents 997ab9d + c12709d commit 6249660

31 files changed

+180
-180
lines changed

src/AuthenticationService.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public function authenticate(ServerRequestInterface $request): ResultInterface
197197

198198
if ($result === null) {
199199
throw new RuntimeException(
200-
'No authenticators loaded. You need to load at least one authenticator.'
200+
'No authenticators loaded. You need to load at least one authenticator.',
201201
);
202202
}
203203

@@ -247,7 +247,7 @@ public function clearIdentity(ServerRequestInterface $request, ResponseInterface
247247
public function persistIdentity(
248248
ServerRequestInterface $request,
249249
ResponseInterface $response,
250-
ArrayAccess|array $identity
250+
ArrayAccess|array $identity,
251251
): array {
252252
foreach ($this->authenticators() as $authenticator) {
253253
if ($authenticator instanceof PersistenceInterface) {
@@ -348,7 +348,7 @@ public function buildIdentity(ArrayAccess|array $identityData): IdentityInterfac
348348
throw new RuntimeException(sprintf(
349349
'Object `%s` does not implement `%s`',
350350
get_class($identity),
351-
IdentityInterface::class
351+
IdentityInterface::class,
352352
));
353353
}
354354

@@ -450,7 +450,7 @@ public function impersonate(
450450
ServerRequestInterface $request,
451451
ResponseInterface $response,
452452
ArrayAccess $impersonator,
453-
ArrayAccess $impersonated
453+
ArrayAccess $impersonated,
454454
): array {
455455
$provider = $this->getImpersonationProvider();
456456

@@ -499,7 +499,7 @@ protected function getImpersonationProvider(): ImpersonationInterface
499499
if (!($provider instanceof ImpersonationInterface)) {
500500
$className = get_class($provider);
501501
throw new InvalidArgumentException(
502-
"The {$className} Provider must implement ImpersonationInterface in order to use impersonation."
502+
"The {$className} Provider must implement ImpersonationInterface in order to use impersonation.",
503503
);
504504
}
505505

src/Authenticator/CookieAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ protected function _createCookie(mixed $value): CookieInterface
238238
return Cookie::create(
239239
$name,
240240
$value,
241-
$options
241+
$options,
242242
);
243243
}
244244
}

src/Authenticator/EnvironmentAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ protected function _buildLoginUrlErrorResult(ServerRequestInterface $request): R
118118
sprintf(
119119
'Login URL `%s` did not match `%s`.',
120120
$uri,
121-
implode('` or `', (array)$this->getConfig('loginUrl'))
121+
implode('` or `', (array)$this->getConfig('loginUrl')),
122122
),
123123
];
124124

src/Authenticator/FormAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ protected function _buildLoginUrlErrorResult(ServerRequestInterface $request): R
100100
sprintf(
101101
'Login URL `%s` did not match `%s`.',
102102
$uri,
103-
implode('` or `', (array)$this->getConfig('loginUrl'))
103+
implode('` or `', (array)$this->getConfig('loginUrl')),
104104
),
105105
];
106106

src/Authenticator/HttpDigestAuthenticator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public function generateResponseHash(array $digest, string $password, string $me
185185
return md5(
186186
$password .
187187
':' . $digest['nonce'] . ':' . $digest['nc'] . ':' . $digest['cnonce'] . ':' . $digest['qop'] . ':' .
188-
md5($method . ':' . $digest['uri'])
188+
md5($method . ':' . $digest['uri']),
189189
);
190190
}
191191

src/Authenticator/ImpersonationInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function impersonate(
3535
ServerRequestInterface $request,
3636
ResponseInterface $response,
3737
ArrayAccess $impersonator,
38-
ArrayAccess $impersonated
38+
ArrayAccess $impersonated,
3939
): array;
4040

4141
/**

src/Authenticator/JwtAuthenticator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function authenticate(ServerRequestInterface $request): ResultInterface
8484
[
8585
'message' => $e->getMessage(),
8686
'exception' => $e,
87-
]
87+
],
8888
);
8989
}
9090

@@ -155,7 +155,7 @@ protected function decodeToken(string $token): ?object
155155

156156
return JWT::decode(
157157
$token,
158-
$keySet
158+
$keySet,
159159
);
160160
}
161161

src/Authenticator/PersistenceInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ interface PersistenceInterface
3434
public function persistIdentity(
3535
ServerRequestInterface $request,
3636
ResponseInterface $response,
37-
ArrayAccess|array $identity
37+
ArrayAccess|array $identity,
3838
): array;
3939

4040
/**

src/Authenticator/SessionAuthenticator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function impersonate(
133133
ServerRequestInterface $request,
134134
ResponseInterface $response,
135135
ArrayAccess $impersonator,
136-
ArrayAccess $impersonated
136+
ArrayAccess $impersonated,
137137
): array {
138138
$sessionKey = $this->getConfig('sessionKey');
139139
$impersonateSessionKey = $this->getConfig('impersonateSessionKey');
@@ -142,7 +142,7 @@ public function impersonate(
142142
if ($session->check($impersonateSessionKey)) {
143143
throw new UnauthorizedException(
144144
'You are impersonating a user already. ' .
145-
'Stop the current impersonation before impersonating another user.'
145+
'Stop the current impersonation before impersonating another user.',
146146
);
147147
}
148148
$session->write($impersonateSessionKey, $impersonator);

src/Controller/Component/AuthenticationComponent.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function getAuthenticationService(): AuthenticationServiceInterface
150150
if ($service === null) {
151151
throw new Exception(
152152
'The request object does not contain the required `authentication` attribute. Verify the ' .
153-
'AuthenticationMiddleware has been added.'
153+
'AuthenticationMiddleware has been added.',
154154
);
155155
}
156156

@@ -303,7 +303,7 @@ public function setIdentity(ArrayAccess $identity)
303303
$result = $service->persistIdentity(
304304
$controller->getRequest(),
305305
$controller->getResponse(),
306-
$identity
306+
$identity,
307307
);
308308

309309
$controller->setRequest($result['request']);
@@ -325,7 +325,7 @@ public function logout(): ?string
325325
/** @psalm-var array{request: \Cake\Http\ServerRequest, response: \Cake\Http\Response} $result */
326326
$result = $this->getAuthenticationService()->clearIdentity(
327327
$controller->getRequest(),
328-
$controller->getResponse()
328+
$controller->getResponse(),
329329
);
330330

331331
$controller->setRequest($result['request']);
@@ -396,7 +396,7 @@ public function impersonate(ArrayAccess $impersonated)
396396
$controller->getRequest(),
397397
$controller->getResponse(),
398398
$impersonator,
399-
$impersonated
399+
$impersonated,
400400
);
401401

402402
if (!$service->isImpersonating($controller->getRequest())) {
@@ -424,7 +424,7 @@ public function stopImpersonating()
424424
/** @psalm-var array{request: \Cake\Http\ServerRequest, response: \Cake\Http\Response} $result */
425425
$result = $service->stopImpersonating(
426426
$controller->getRequest(),
427-
$controller->getResponse()
427+
$controller->getResponse(),
428428
);
429429

430430
if ($service->isImpersonating($controller->getRequest())) {
@@ -453,7 +453,7 @@ public function isImpersonating(): bool
453453
$controller = $this->getController();
454454

455455
return $service->isImpersonating(
456-
$controller->getRequest()
456+
$controller->getRequest(),
457457
);
458458
}
459459

@@ -469,7 +469,7 @@ protected function getImpersonationAuthenticationService(): ImpersonationInterfa
469469
if (!($service instanceof ImpersonationInterface)) {
470470
$className = get_class($service);
471471
throw new InvalidArgumentException(
472-
"The {$className} must implement ImpersonationInterface in order to use impersonation."
472+
"The {$className} must implement ImpersonationInterface in order to use impersonation.",
473473
);
474474
}
475475

0 commit comments

Comments
 (0)