diff --git a/Authentication/AuthenticationProviderManager.php b/Authentication/AuthenticationProviderManager.php index 0c0a2062..a0c95ab8 100644 --- a/Authentication/AuthenticationProviderManager.php +++ b/Authentication/AuthenticationProviderManager.php @@ -65,7 +65,7 @@ public function authenticate(TokenInterface $token) foreach ($this->providers as $provider) { if (!$provider instanceof AuthenticationProviderInterface) { - throw new \InvalidArgumentException(sprintf('Provider "%s" must implement the AuthenticationProviderInterface.', \get_class($provider))); + throw new \InvalidArgumentException(sprintf('Provider "%s" must implement the AuthenticationProviderInterface.', get_debug_type($provider))); } if (!$provider->supports($token)) { diff --git a/Authentication/Provider/RememberMeAuthenticationProvider.php b/Authentication/Provider/RememberMeAuthenticationProvider.php index 670390e4..9a688adc 100644 --- a/Authentication/Provider/RememberMeAuthenticationProvider.php +++ b/Authentication/Provider/RememberMeAuthenticationProvider.php @@ -52,7 +52,7 @@ public function authenticate(TokenInterface $token) $user = $token->getUser(); if (!$token->getUser() instanceof UserInterface) { - throw new LogicException(sprintf('Method "%s::getUser()" must return a "%s" instance, "%s" returned.', \get_class($token), UserInterface::class, \is_object($user) ? \get_class($user) : \gettype($user))); + throw new LogicException(sprintf('Method "%s::getUser()" must return a "%s" instance, "%s" returned.', get_debug_type($token), UserInterface::class, get_debug_type($user))); } $this->userChecker->checkPreAuth($user); diff --git a/Encoder/EncoderFactory.php b/Encoder/EncoderFactory.php index cad50180..06bc591e 100644 --- a/Encoder/EncoderFactory.php +++ b/Encoder/EncoderFactory.php @@ -50,7 +50,7 @@ public function getEncoder($user) } if (null === $encoderKey) { - throw new \RuntimeException(sprintf('No encoder has been configured for account "%s".', \is_object($user) ? \get_class($user) : $user)); + throw new \RuntimeException(sprintf('No encoder has been configured for account "%s".', \is_object($user) ? get_debug_type($user) : $user)); } if (!$this->encoders[$encoderKey] instanceof PasswordEncoderInterface) { diff --git a/User/ChainUserProvider.php b/User/ChainUserProvider.php index af5a0ebb..23321250 100644 --- a/User/ChainUserProvider.php +++ b/User/ChainUserProvider.php @@ -91,7 +91,7 @@ public function refreshUser(UserInterface $user) $e->setUsername($user->getUsername()); throw $e; } else { - throw new UnsupportedUserException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', \get_class($user))); + throw new UnsupportedUserException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', get_debug_type($user))); } } diff --git a/User/InMemoryUserProvider.php b/User/InMemoryUserProvider.php index 71bdec54..8d084cd5 100644 --- a/User/InMemoryUserProvider.php +++ b/User/InMemoryUserProvider.php @@ -74,7 +74,7 @@ public function loadUserByUsername(string $username) public function refreshUser(UserInterface $user) { if (!$user instanceof User) { - throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', \get_class($user))); + throw new UnsupportedUserException(sprintf('Instances of "%s" are not supported.', get_debug_type($user))); } $storedUser = $this->getUser($user->getUsername()); diff --git a/composer.json b/composer.json index c8bfb07d..fc500b28 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,7 @@ "require": { "php": "^7.2.5", "symfony/event-dispatcher-contracts": "^1.1|^2", + "symfony/polyfill-php80": "^1.15", "symfony/service-contracts": "^1.1.6|^2", "symfony/deprecation-contracts": "^2.1" },