Skip to content

Commit b7df8ff

Browse files
committed
Add missing dots at the end of exception messages
1 parent 20abb20 commit b7df8ff

11 files changed

+15
-15
lines changed

Authentication/SimpleAuthenticationHandler.php

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

6666
if (null !== $response) {
67-
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)));
67+
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)));
6868
}
6969
}
7070

@@ -91,7 +91,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
9191
}
9292

9393
if (null !== $response) {
94-
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)));
94+
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)));
9595
}
9696
}
9797

Firewall/DigestAuthenticationListener.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function handle(GetResponseEvent $event)
9494
$user = $this->provider->loadUserByUsername($digestAuth->getUsername());
9595

9696
if (null === $user) {
97-
throw new AuthenticationServiceException('Digest User provider returned null, which is an interface contract violation');
97+
throw new AuthenticationServiceException('Digest User provider returned null, which is an interface contract violation.');
9898
}
9999

100100
$serverDigestMd5 = $digestAuth->calculateServerDigest($user->getPassword(), $request->getMethod());
@@ -199,11 +199,11 @@ public function getUsername()
199199
public function validateAndDecode($entryPointKey, $expectedRealm)
200200
{
201201
if ($keys = array_diff(['username', 'realm', 'nonce', 'uri', 'response'], array_keys($this->elements))) {
202-
throw new BadCredentialsException(sprintf('Missing mandatory digest value; received header "%s" (%s)', $this->header, implode(', ', $keys)));
202+
throw new BadCredentialsException(sprintf('Missing mandatory digest value; received header "%s" (%s).', $this->header, implode(', ', $keys)));
203203
}
204204

205205
if ('auth' === $this->elements['qop'] && !isset($this->elements['nc'], $this->elements['cnonce'])) {
206-
throw new BadCredentialsException(sprintf('Missing mandatory digest value; received header "%s"', $this->header));
206+
throw new BadCredentialsException(sprintf('Missing mandatory digest value; received header "%s".', $this->header));
207207
}
208208

209209
if ($expectedRealm !== $this->elements['realm']) {

Firewall/ExceptionListener.php

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

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

218218
return $response;

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];

Firewall/SimpleFormAuthenticationListener.php

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

6060
$this->simpleAuthenticator = $simpleAuthenticator;

Firewall/SimplePreAuthenticationListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function handle(GetResponseEvent $event)
120120
if ($response instanceof Response) {
121121
$event->setResponse($response);
122122
} elseif (null !== $response) {
123-
throw new \UnexpectedValueException(sprintf('The %s::onAuthenticationFailure method must return null or a Response object', \get_class($this->simpleAuthenticator)));
123+
throw new \UnexpectedValueException(sprintf('The %s::onAuthenticationFailure method must return null or a Response object.', \get_class($this->simpleAuthenticator)));
124124
}
125125
}
126126

@@ -132,7 +132,7 @@ public function handle(GetResponseEvent $event)
132132
if ($response instanceof Response) {
133133
$event->setResponse($response);
134134
} elseif (null !== $response) {
135-
throw new \UnexpectedValueException(sprintf('The %s::onAuthenticationSuccess method must return null or a Response object', \get_class($this->simpleAuthenticator)));
135+
throw new \UnexpectedValueException(sprintf('The %s::onAuthenticationSuccess method must return null or a Response object.', \get_class($this->simpleAuthenticator)));
136136
}
137137
}
138138
}

Firewall/SwitchUserListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function handle(GetResponseEvent $event)
100100
try {
101101
$this->tokenStorage->setToken($this->attemptSwitchUser($request, $username));
102102
} catch (AuthenticationException $e) {
103-
throw new \LogicException(sprintf('Switch User failed: "%s"', $e->getMessage()));
103+
throw new \LogicException(sprintf('Switch User failed: "%s".', $e->getMessage()));
104104
}
105105
}
106106

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, '')];

RememberMe/AbstractRememberMeServices.php

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

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
}

Tests/Firewall/ExceptionListenerTest.php

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

9292
/**

0 commit comments

Comments
 (0)