Skip to content

Commit 5e9bf39

Browse files
committed
Enable the fixer enforcing fully-qualified calls for compiler-optimized functions
1 parent 892403b commit 5e9bf39

9 files changed

+22
-22
lines changed

Authentication/SimpleAuthenticationHandler.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token)
5555
{
5656
if ($this->simpleAuthenticator instanceof AuthenticationSuccessHandlerInterface) {
5757
if ($this->logger) {
58-
$this->logger->debug('Selected an authentication success handler.', array('handler' => get_class($this->simpleAuthenticator)));
58+
$this->logger->debug('Selected an authentication success handler.', array('handler' => \get_class($this->simpleAuthenticator)));
5959
}
6060

6161
$response = $this->simpleAuthenticator->onAuthenticationSuccess($request, $token);
@@ -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

@@ -82,7 +82,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
8282
{
8383
if ($this->simpleAuthenticator instanceof AuthenticationFailureHandlerInterface) {
8484
if ($this->logger) {
85-
$this->logger->debug('Selected an authentication failure handler.', array('handler' => get_class($this->simpleAuthenticator)));
85+
$this->logger->debug('Selected an authentication failure handler.', array('handler' => \get_class($this->simpleAuthenticator)));
8686
}
8787

8888
$response = $this->simpleAuthenticator->onAuthenticationFailure($request, $exception);
@@ -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/ContextListener.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(TokenStorageInterface $tokenStorage, array $userProv
4747

4848
foreach ($userProviders as $userProvider) {
4949
if (!$userProvider instanceof UserProviderInterface) {
50-
throw new \InvalidArgumentException(sprintf('User provider "%s" must implement "Symfony\Component\Security\Core\User\UserProviderInterface".', get_class($userProvider)));
50+
throw new \InvalidArgumentException(sprintf('User provider "%s" must implement "Symfony\Component\Security\Core\User\UserProviderInterface".', \get_class($userProvider)));
5151
}
5252
}
5353

@@ -150,15 +150,15 @@ protected function refreshUser(TokenInterface $token)
150150
$token->setUser($refreshedUser);
151151

152152
if (null !== $this->logger) {
153-
$this->logger->debug('User was reloaded from a user provider.', array('username' => $refreshedUser->getUsername(), 'provider' => get_class($provider)));
153+
$this->logger->debug('User was reloaded from a user provider.', array('username' => $refreshedUser->getUsername(), 'provider' => \get_class($provider)));
154154
}
155155

156156
return $token;
157157
} catch (UnsupportedUserException $e) {
158158
// let's try the next user provider
159159
} catch (UsernameNotFoundException $e) {
160160
if (null !== $this->logger) {
161-
$this->logger->warning('Username could not be found in the selected user provider.', array('username' => $e->getUsername(), 'provider' => get_class($provider)));
161+
$this->logger->warning('Username could not be found in the selected user provider.', array('username' => $e->getUsername(), 'provider' => \get_class($provider)));
162162
}
163163

164164
$userNotFoundByProvider = true;
@@ -169,7 +169,7 @@ protected function refreshUser(TokenInterface $token)
169169
return null;
170170
}
171171

172-
throw new \RuntimeException(sprintf('There is no user provider for user "%s".', get_class($user)));
172+
throw new \RuntimeException(sprintf('There is no user provider for user "%s".', \get_class($user)));
173173
}
174174

175175
private function safelyUnserialize($serializedToken)

Firewall/DigestAuthenticationListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ public function validateAndDecode($entryPointKey, $expectedRealm)
207207

208208
$nonceTokens = explode(':', $nonceAsPlainText);
209209

210-
if (2 !== count($nonceTokens)) {
210+
if (2 !== \count($nonceTokens)) {
211211
throw new BadCredentialsException(sprintf('Nonce should have yielded two tokens but was "%s".', $nonceAsPlainText));
212212
}
213213

Firewall/SimplePreAuthenticationListener.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function handle(GetResponseEvent $event)
8383
$request = $event->getRequest();
8484

8585
if (null !== $this->logger) {
86-
$this->logger->info('Attempting SimplePreAuthentication.', array('key' => $this->providerKey, 'authenticator' => get_class($this->simpleAuthenticator)));
86+
$this->logger->info('Attempting SimplePreAuthentication.', array('key' => $this->providerKey, 'authenticator' => \get_class($this->simpleAuthenticator)));
8787
}
8888

8989
if (null !== $this->tokenStorage->getToken() && !$this->tokenStorage->getToken() instanceof AnonymousToken) {
@@ -112,15 +112,15 @@ public function handle(GetResponseEvent $event)
112112
$this->tokenStorage->setToken(null);
113113

114114
if (null !== $this->logger) {
115-
$this->logger->info('SimplePreAuthentication request failed.', array('exception' => $e, 'authenticator' => get_class($this->simpleAuthenticator)));
115+
$this->logger->info('SimplePreAuthentication request failed.', array('exception' => $e, 'authenticator' => \get_class($this->simpleAuthenticator)));
116116
}
117117

118118
if ($this->simpleAuthenticator instanceof AuthenticationFailureHandlerInterface) {
119119
$response = $this->simpleAuthenticator->onAuthenticationFailure($request, $e);
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/UsernamePasswordFormAuthenticationListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ protected function attemptAuthentication(Request $request)
110110

111111
$username = trim($username);
112112

113-
if (strlen($username) > Security::MAX_USERNAME_LENGTH) {
113+
if (\strlen($username) > Security::MAX_USERNAME_LENGTH) {
114114
throw new BadCredentialsException('Invalid username.');
115115
}
116116

RememberMe/AbstractRememberMeServices.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __construct(array $userProviders, $secret, $providerKey, array $
6060
if (empty($providerKey)) {
6161
throw new \InvalidArgumentException('$providerKey must not be empty.');
6262
}
63-
if (0 === count($userProviders)) {
63+
if (0 === \count($userProviders)) {
6464
throw new \InvalidArgumentException('You must provide at least one user provider.');
6565
}
6666

RememberMe/PersistentTokenBasedRememberMeServices.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ protected function cancelCookie(Request $request)
6767

6868
// Delete cookie from the tokenProvider
6969
if (null !== ($cookie = $request->cookies->get($this->options['name']))
70-
&& 2 === count($parts = $this->decodeCookie($cookie))
70+
&& 2 === \count($parts = $this->decodeCookie($cookie))
7171
) {
7272
list($series) = $parts;
7373
$this->tokenProvider->deleteTokenBySeries($series);
@@ -79,7 +79,7 @@ protected function cancelCookie(Request $request)
7979
*/
8080
protected function processAutoLoginCookie(array $cookieParts, Request $request)
8181
{
82-
if (2 !== count($cookieParts)) {
82+
if (2 !== \count($cookieParts)) {
8383
throw new AuthenticationException('The cookie is invalid.');
8484
}
8585

@@ -121,7 +121,7 @@ protected function onLoginSuccess(Request $request, Response $response, TokenInt
121121

122122
$this->tokenProvider->createNewToken(
123123
new PersistentToken(
124-
get_class($user = $token->getUser()),
124+
\get_class($user = $token->getUser()),
125125
$user->getUsername(),
126126
$series,
127127
$tokenValue,

RememberMe/TokenBasedRememberMeServices.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class TokenBasedRememberMeServices extends AbstractRememberMeServices
3131
*/
3232
protected function processAutoLoginCookie(array $cookieParts, Request $request)
3333
{
34-
if (4 !== count($cookieParts)) {
34+
if (4 !== \count($cookieParts)) {
3535
throw new AuthenticationException('The cookie is invalid.');
3636
}
3737

@@ -50,7 +50,7 @@ protected function processAutoLoginCookie(array $cookieParts, Request $request)
5050
}
5151

5252
if (!$user instanceof UserInterface) {
53-
throw new \RuntimeException(sprintf('The UserProviderInterface implementation must return an instance of UserInterface, but returned "%s".', get_class($user)));
53+
throw new \RuntimeException(sprintf('The UserProviderInterface implementation must return an instance of UserInterface, but returned "%s".', \get_class($user)));
5454
}
5555

5656
if (true !== hash_equals($this->generateCookieHash($class, $username, $expires, $user->getPassword()), $hash)) {
@@ -71,7 +71,7 @@ protected function onLoginSuccess(Request $request, Response $response, TokenInt
7171
{
7272
$user = $token->getUser();
7373
$expires = time() + $this->options['lifetime'];
74-
$value = $this->generateCookieValue(get_class($user), $user->getUsername(), $expires, $user->getPassword());
74+
$value = $this->generateCookieValue(\get_class($user), $user->getUsername(), $expires, $user->getPassword());
7575

7676
$response->headers->setCookie(
7777
new Cookie(

Tests/RememberMe/AbstractRememberMeServicesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ protected function getProvider()
304304

305305
private function callProtected($object, $method, array $args)
306306
{
307-
$reflection = new \ReflectionClass(get_class($object));
307+
$reflection = new \ReflectionClass(\get_class($object));
308308
$reflectionMethod = $reflection->getMethod($method);
309309
$reflectionMethod->setAccessible(true);
310310

0 commit comments

Comments
 (0)