Skip to content

Commit

Permalink
Enable "native_constant_invocation" CS rule
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Sep 2, 2020
1 parent 54bf96a commit 8347ac1
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Authentication/Token/AbstractToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function __toString()
protected function doSerialize($serialized, $isCalledFromOverridingMethod)
{
if (null === $isCalledFromOverridingMethod) {
$trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 3);
$trace = debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT, 3);
$isCalledFromOverridingMethod = isset($trace[2]['function'], $trace[2]['object']) && 'serialize' === $trace[2]['function'] && $this === $trace[2]['object'];
}

Expand Down
4 changes: 2 additions & 2 deletions Authorization/AccessDecisionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct($voters = [], $strategy = self::STRATEGY_AFFIRMATIVE
*/
public function setVoters(array $voters)
{
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Pass the voters to the constructor instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Pass the voters to the constructor instead.', __METHOD__), \E_USER_DEPRECATED);

$this->voters = $voters;
}
Expand Down Expand Up @@ -191,7 +191,7 @@ private function vote($voter, TokenInterface $token, $subject, $attributes)
}

if (method_exists($voter, 'vote')) {
@trigger_error(sprintf('Calling vote() on an voter without %1$s is deprecated as of 3.4 and will be removed in 4.0. Implement the %1$s on your voter.', VoterInterface::class), E_USER_DEPRECATED);
@trigger_error(sprintf('Calling vote() on an voter without %1$s is deprecated as of 3.4 and will be removed in 4.0. Implement the %1$s on your voter.', VoterInterface::class), \E_USER_DEPRECATED);

// making the assumption that the signature matches
return $voter->vote($token, $subject, $attributes);
Expand Down
2 changes: 1 addition & 1 deletion Authorization/TraceableAccessDecisionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function decide(TokenInterface $token, array $attributes, $object = null)
*/
public function setVoters(array $voters)
{
@trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Pass voters to the decorated AccessDecisionManager instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Pass voters to the decorated AccessDecisionManager instead.', __METHOD__), \E_USER_DEPRECATED);

if (!method_exists($this->manager, 'setVoters')) {
return;
Expand Down
8 changes: 4 additions & 4 deletions Encoder/Argon2iPasswordEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static function isSupported()
return true;
}

return version_compare(\extension_loaded('sodium') ? SODIUM_LIBRARY_VERSION : phpversion('libsodium'), '1.0.9', '>=');
return version_compare(\extension_loaded('sodium') ? \SODIUM_LIBRARY_VERSION : phpversion('libsodium'), '1.0.9', '>=');
}

/**
Expand Down Expand Up @@ -79,15 +79,15 @@ public function isPasswordValid($encoded, $raw, $salt)

private function encodePasswordNative($raw)
{
return password_hash($raw, PASSWORD_ARGON2I);
return password_hash($raw, \PASSWORD_ARGON2I);
}

private function encodePasswordSodiumFunction($raw)
{
$hash = sodium_crypto_pwhash_str(
$raw,
SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE,
SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE
\SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE,
\SODIUM_CRYPTO_PWHASH_MEMLIMIT_INTERACTIVE
);
sodium_memzero($raw);

Expand Down
2 changes: 1 addition & 1 deletion Encoder/BCryptPasswordEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function encodePassword($raw, $salt)
// Ignore $salt, the auto-generated one is always the best
}

return password_hash($raw, PASSWORD_BCRYPT, $options);
return password_hash($raw, \PASSWORD_BCRYPT, $options);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Exception/AuthenticationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function serialize()
protected function doSerialize($serialized, $isCalledFromOverridingMethod)
{
if (null === $isCalledFromOverridingMethod) {
$trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 3);
$trace = debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT, 3);
$isCalledFromOverridingMethod = isset($trace[2]['function'], $trace[2]['object']) && 'serialize' === $trace[2]['function'] && $this === $trace[2]['object'];
}

Expand Down
2 changes: 1 addition & 1 deletion Exception/NonceExpiredException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Symfony\Component\Security\Core\Exception;

@trigger_error(sprintf('The %s class and the whole HTTP digest authentication system is deprecated since Symfony 3.4 and will be removed in 4.0.', NonceExpiredException::class), E_USER_DEPRECATED);
@trigger_error(sprintf('The %s class and the whole HTTP digest authentication system is deprecated since Symfony 3.4 and will be removed in 4.0.', NonceExpiredException::class), \E_USER_DEPRECATED);

/**
* NonceExpiredException is thrown when an authentication is rejected because
Expand Down

0 comments on commit 8347ac1

Please sign in to comment.