Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit a8f1f90

Browse files
committed
Merge branch '3.4' into 4.4
* 3.4: Add missing dots at the end of exception messages
2 parents 0718136 + 931ca20 commit a8f1f90

11 files changed

+13
-13
lines changed

Core/Authentication/Provider/LdapBindAuthenticationProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function setQueryString($queryString)
6464
protected function retrieveUser($username, UsernamePasswordToken $token)
6565
{
6666
if (AuthenticationProviderInterface::USERNAME_NONE_PROVIDED === $username) {
67-
throw new UsernameNotFoundException('Username can not be null');
67+
throw new UsernameNotFoundException('Username can not be null.');
6868
}
6969

7070
return $this->userProvider->loadUserByUsername($username);

Guard/Provider/GuardAuthenticationProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private function authenticateViaGuard(AuthenticatorInterface $guardAuthenticator
105105
$user = $guardAuthenticator->getUser($token->getCredentials(), $this->userProvider);
106106

107107
if (null === $user) {
108-
throw new UsernameNotFoundException(sprintf('Null returned from %s::getUser()', \get_class($guardAuthenticator)));
108+
throw new UsernameNotFoundException(sprintf('Null returned from %s::getUser().', \get_class($guardAuthenticator)));
109109
}
110110

111111
if (!$user instanceof UserInterface) {

Http/Authentication/SimpleAuthenticationHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token)
6262
}
6363

6464
if (null !== $response) {
65-
throw new \UnexpectedValueException(sprintf('The %s::onAuthenticationSuccess method must return null to use the default success handler, or a Response object', \get_class($this->simpleAuthenticator)));
65+
throw new \UnexpectedValueException(sprintf('The %s::onAuthenticationSuccess method must return null to use the default success handler, or a Response object.', \get_class($this->simpleAuthenticator)));
6666
}
6767
}
6868

@@ -89,7 +89,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
8989
}
9090

9191
if (null !== $response) {
92-
throw new \UnexpectedValueException(sprintf('The %s::onAuthenticationFailure method must return null to use the default failure handler, or a Response object', \get_class($this->simpleAuthenticator)));
92+
throw new \UnexpectedValueException(sprintf('The %s::onAuthenticationFailure method must return null to use the default failure handler, or a Response object.', \get_class($this->simpleAuthenticator)));
9393
}
9494
}
9595

Http/Firewall/ExceptionListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ private function startAuthentication(Request $request, AuthenticationException $
216216
if (!$response instanceof Response) {
217217
$given = \is_object($response) ? \get_class($response) : \gettype($response);
218218

219-
throw new \LogicException(sprintf('The %s::start() method must return a Response object (%s returned)', \get_class($this->authenticationEntryPoint), $given));
219+
throw new \LogicException(sprintf('The %s::start() method must return a Response object (%s returned).', \get_class($this->authenticationEntryPoint), $given));
220220
}
221221

222222
return $response;

Http/Firewall/RemoteUserAuthenticationListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(TokenStorageInterface $tokenStorage, AuthenticationM
4141
protected function getPreAuthenticatedData(Request $request)
4242
{
4343
if (!$request->server->has($this->userKey)) {
44-
throw new BadCredentialsException(sprintf('User key was not found: %s', $this->userKey));
44+
throw new BadCredentialsException(sprintf('User key was not found: %s.', $this->userKey));
4545
}
4646

4747
return [$request->server->get($this->userKey), null];

Http/Firewall/SimpleFormAuthenticationListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class SimpleFormAuthenticationListener extends AbstractAuthenticationListener
4747
public function __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, SessionAuthenticationStrategyInterface $sessionStrategy, HttpUtils $httpUtils, string $providerKey, AuthenticationSuccessHandlerInterface $successHandler, AuthenticationFailureHandlerInterface $failureHandler, array $options = [], LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, CsrfTokenManagerInterface $csrfTokenManager = null, SimpleFormAuthenticatorInterface $simpleAuthenticator = null)
4848
{
4949
if (!$simpleAuthenticator) {
50-
throw new \InvalidArgumentException('Missing simple authenticator');
50+
throw new \InvalidArgumentException('Missing simple authenticator.');
5151
}
5252

5353
$this->simpleAuthenticator = $simpleAuthenticator;

Http/Firewall/SimplePreAuthenticationListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function authenticate(RequestEvent $event)
146146
if ($response instanceof Response) {
147147
$event->setResponse($response);
148148
} elseif (null !== $response) {
149-
throw new \UnexpectedValueException(sprintf('The %s::onAuthenticationFailure method must return null or a Response object', \get_class($this->simpleAuthenticator)));
149+
throw new \UnexpectedValueException(sprintf('The %s::onAuthenticationFailure method must return null or a Response object.', \get_class($this->simpleAuthenticator)));
150150
}
151151
}
152152

@@ -158,7 +158,7 @@ public function authenticate(RequestEvent $event)
158158
if ($response instanceof Response) {
159159
$event->setResponse($response);
160160
} elseif (null !== $response) {
161-
throw new \UnexpectedValueException(sprintf('The %s::onAuthenticationSuccess method must return null or a Response object', \get_class($this->simpleAuthenticator)));
161+
throw new \UnexpectedValueException(sprintf('The %s::onAuthenticationSuccess method must return null or a Response object.', \get_class($this->simpleAuthenticator)));
162162
}
163163
}
164164
}

Http/Firewall/X509AuthenticationListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected function getPreAuthenticatedData(Request $request)
5252
}
5353

5454
if (null === $user) {
55-
throw new BadCredentialsException(sprintf('SSL credentials not found: %s, %s', $this->userKey, $this->credentialKey));
55+
throw new BadCredentialsException(sprintf('SSL credentials not found: %s, %s.', $this->userKey, $this->credentialKey));
5656
}
5757

5858
return [$user, $request->server->get($this->credentialKey, '')];

Http/RememberMe/AbstractRememberMeServices.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ protected function encodeCookie(array $cookieParts)
260260
{
261261
foreach ($cookieParts as $cookiePart) {
262262
if (false !== strpos($cookiePart, self::COOKIE_DELIMITER)) {
263-
throw new \InvalidArgumentException(sprintf('$cookieParts should not contain the cookie delimiter "%s"', self::COOKIE_DELIMITER));
263+
throw new \InvalidArgumentException(sprintf('$cookieParts should not contain the cookie delimiter "%s".', self::COOKIE_DELIMITER));
264264
}
265265
}
266266

Http/Session/SessionAuthenticationStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function onAuthentication(Request $request, TokenInterface $token)
5959
return;
6060

6161
default:
62-
throw new \RuntimeException(sprintf('Invalid session authentication strategy "%s"', $this->strategy));
62+
throw new \RuntimeException(sprintf('Invalid session authentication strategy "%s".', $this->strategy));
6363
}
6464
}
6565
}

Http/Tests/Firewall/ExceptionListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function testExceptionWhenEntryPointReturnsBadValue()
8383
$listener->onKernelException($event);
8484
// the exception has been replaced by our LogicException
8585
$this->assertInstanceOf('LogicException', $event->getThrowable());
86-
$this->assertStringEndsWith('start() method must return a Response object (string returned)', $event->getThrowable()->getMessage());
86+
$this->assertStringEndsWith('start() method must return a Response object (string returned).', $event->getThrowable()->getMessage());
8787
}
8888

8989
/**

0 commit comments

Comments
 (0)