Skip to content

Commit 1b6a0e5

Browse files
Merge branch '2.8' into 3.4
* 2.8: Fix Clidumper tests Enable the fixer enforcing fully-qualified calls for compiler-optimized functions Apply fixers Disable the native_constant_invocation fixer until it can be scoped Update the list of excluded files for the CS fixer
2 parents 44d0ebd + 48093b3 commit 1b6a0e5

18 files changed

+30
-30
lines changed

Authentication/AuthenticationProviderManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function authenticate(TokenInterface $token)
6565

6666
foreach ($this->providers as $provider) {
6767
if (!$provider instanceof AuthenticationProviderInterface) {
68-
throw new \InvalidArgumentException(sprintf('Provider "%s" must implement the AuthenticationProviderInterface.', get_class($provider)));
68+
throw new \InvalidArgumentException(sprintf('Provider "%s" must implement the AuthenticationProviderInterface.', \get_class($provider)));
6969
}
7070

7171
if (!$provider->supports($token)) {
@@ -100,7 +100,7 @@ public function authenticate(TokenInterface $token)
100100
}
101101

102102
if (null === $lastException) {
103-
$lastException = new ProviderNotFoundException(sprintf('No Authentication Provider found for token of class "%s".', get_class($token)));
103+
$lastException = new ProviderNotFoundException(sprintf('No Authentication Provider found for token of class "%s".', \get_class($token)));
104104
}
105105

106106
if (null !== $this->eventDispatcher) {

Authentication/Token/AbstractToken.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ abstract class AbstractToken implements TokenInterface
3838
public function __construct(array $roles = array())
3939
{
4040
foreach ($roles as $role) {
41-
if (is_string($role)) {
41+
if (\is_string($role)) {
4242
$role = new Role($role);
4343
} elseif (!$role instanceof RoleInterface) {
44-
throw new \InvalidArgumentException(sprintf('$roles must be an array of strings, Role instances or RoleInterface instances, but got %s.', gettype($role)));
44+
throw new \InvalidArgumentException(sprintf('$roles must be an array of strings, Role instances or RoleInterface instances, but got %s.', \gettype($role)));
4545
}
4646

4747
$this->roles[] = $role;
@@ -81,7 +81,7 @@ public function getUser()
8181
*/
8282
public function setUser($user)
8383
{
84-
if (!($user instanceof UserInterface || (is_object($user) && method_exists($user, '__toString')) || is_string($user))) {
84+
if (!($user instanceof UserInterface || (\is_object($user) && method_exists($user, '__toString')) || \is_string($user))) {
8585
throw new \InvalidArgumentException('$user must be an instanceof UserInterface, an object implementing a __toString method, or a primitive string.');
8686
}
8787

@@ -139,7 +139,7 @@ public function serialize()
139139
{
140140
return serialize(
141141
array(
142-
is_object($this->user) ? clone $this->user : $this->user,
142+
\is_object($this->user) ? clone $this->user : $this->user,
143143
$this->authenticated,
144144
array_map(function ($role) { return clone $role; }, $this->roles),
145145
$this->attributes,
@@ -221,7 +221,7 @@ public function setAttribute($name, $value)
221221
*/
222222
public function __toString()
223223
{
224-
$class = get_class($this);
224+
$class = \get_class($this);
225225
$class = substr($class, strrpos($class, '\\') + 1);
226226

227227
$roles = array();

Authentication/Token/UsernamePasswordToken.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct($user, $credentials, $providerKey, array $roles = ar
4343
$this->credentials = $credentials;
4444
$this->providerKey = $providerKey;
4545

46-
parent::setAuthenticated(count($roles) > 0);
46+
parent::setAuthenticated(\count($roles) > 0);
4747
}
4848

4949
/**

Authorization/AccessDecisionManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class AccessDecisionManager implements AccessDecisionManagerInterface
4343
public function __construct($voters = array(), $strategy = self::STRATEGY_AFFIRMATIVE, $allowIfAllAbstainDecisions = false, $allowIfEqualGrantedDeniedDecisions = true)
4444
{
4545
$strategyMethod = 'decide'.ucfirst($strategy);
46-
if (!is_callable(array($this, $strategyMethod))) {
46+
if (!\is_callable(array($this, $strategyMethod))) {
4747
throw new \InvalidArgumentException(sprintf('The strategy "%s" is not supported.', $strategy));
4848
}
4949

@@ -212,6 +212,6 @@ private function vote($voter, TokenInterface $token, $subject, $attributes)
212212
return $voter->vote($token, $subject, $attributes);
213213
}
214214

215-
throw new LogicException(sprintf('%s should implement the %s interface when used as voter.', get_class($voter), VoterInterface::class));
215+
throw new LogicException(sprintf('%s should implement the %s interface when used as voter.', \get_class($voter), VoterInterface::class));
216216
}
217217
}

Authorization/AuthorizationChecker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ final public function isGranted($attributes, $subject = null)
5959
$this->tokenStorage->setToken($token = $this->authenticationManager->authenticate($token));
6060
}
6161

62-
if (!is_array($attributes)) {
62+
if (!\is_array($attributes)) {
6363
$attributes = array($attributes);
6464
}
6565

Authorization/ExpressionLanguageProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function getFunctions()
5151
new ExpressionFunction('has_role', function ($role) {
5252
return sprintf('in_array(%s, $roles)', $role);
5353
}, function (array $variables, $role) {
54-
return in_array($role, $variables['roles']);
54+
return \in_array($role, $variables['roles']);
5555
}),
5656
);
5757
}

Authorization/Voter/RoleVoter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function vote(TokenInterface $token, $subject, array $attributes)
4444
$attribute = $attribute->getRole();
4545
}
4646

47-
if (!is_string($attribute) || 0 !== strpos($attribute, $this->prefix)) {
47+
if (!\is_string($attribute) || 0 !== strpos($attribute, $this->prefix)) {
4848
continue;
4949
}
5050

Encoder/BasePasswordEncoder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected function demergePasswordAndSalt($mergedPasswordSalt)
3737
$salt = '';
3838
$saltBegins = strrpos($mergedPasswordSalt, '{');
3939

40-
if (false !== $saltBegins && $saltBegins + 1 < strlen($mergedPasswordSalt)) {
40+
if (false !== $saltBegins && $saltBegins + 1 < \strlen($mergedPasswordSalt)) {
4141
$salt = substr($mergedPasswordSalt, $saltBegins + 1, -1);
4242
$password = substr($mergedPasswordSalt, 0, $saltBegins);
4343
}
@@ -93,6 +93,6 @@ protected function comparePasswords($password1, $password2)
9393
*/
9494
protected function isPasswordTooLong($password)
9595
{
96-
return strlen($password) > static::MAX_PASSWORD_LENGTH;
96+
return \strlen($password) > static::MAX_PASSWORD_LENGTH;
9797
}
9898
}

Encoder/EncoderFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ public function getEncoder($user)
4040
$encoderKey = $encoderName;
4141
} else {
4242
foreach ($this->encoders as $class => $encoder) {
43-
if ((is_object($user) && $user instanceof $class) || (!is_object($user) && (is_subclass_of($user, $class) || $user == $class))) {
43+
if ((\is_object($user) && $user instanceof $class) || (!\is_object($user) && (is_subclass_of($user, $class) || $user == $class))) {
4444
$encoderKey = $class;
4545
break;
4646
}
4747
}
4848
}
4949

5050
if (null === $encoderKey) {
51-
throw new \RuntimeException(sprintf('No encoder has been configured for account "%s".', is_object($user) ? get_class($user) : $user));
51+
throw new \RuntimeException(sprintf('No encoder has been configured for account "%s".', \is_object($user) ? \get_class($user) : $user));
5252
}
5353

5454
if (!$this->encoders[$encoderKey] instanceof PasswordEncoderInterface) {

Encoder/MessageDigestPasswordEncoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function encodePassword($raw, $salt)
4545
throw new BadCredentialsException('Invalid password.');
4646
}
4747

48-
if (!in_array($this->algorithm, hash_algos(), true)) {
48+
if (!\in_array($this->algorithm, hash_algos(), true)) {
4949
throw new \LogicException(sprintf('The algorithm "%s" is not supported.', $this->algorithm));
5050
}
5151

0 commit comments

Comments
 (0)