diff --git a/src/Symfony/Component/PasswordHasher/Command/UserPasswordHashCommand.php b/src/Symfony/Component/PasswordHasher/Command/UserPasswordHashCommand.php index b74e0e0d26..edee8a2978 100644 --- a/src/Symfony/Component/PasswordHasher/Command/UserPasswordHashCommand.php +++ b/src/Symfony/Component/PasswordHasher/Command/UserPasswordHashCommand.php @@ -11,7 +11,6 @@ namespace Symfony\Component\PasswordHasher\Command; - use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Exception\InvalidArgumentException; use Symfony\Component\Console\Exception\RuntimeException; @@ -36,7 +35,7 @@ use Symfony\Component\PasswordHasher\LegacyPasswordHasherInterface; class UserPasswordHashCommand extends Command { protected static $defaultName = 'security:hash-password'; - protected static $defaultDescription = "Hashes a user password"; + protected static $defaultDescription = 'Hashes a user password'; private $hasherFactory; private $userClasses; diff --git a/src/Symfony/Component/PasswordHasher/Exception/InvalidPasswordException.php b/src/Symfony/Component/PasswordHasher/Exception/InvalidPasswordException.php index dea9109bae..c70a4d5561 100644 --- a/src/Symfony/Component/PasswordHasher/Exception/InvalidPasswordException.php +++ b/src/Symfony/Component/PasswordHasher/Exception/InvalidPasswordException.php @@ -13,7 +13,7 @@ namespace Symfony\Component\PasswordHasher\Exception; /** * @author Robin Chalas -*/ + */ class InvalidPasswordException extends \RuntimeException implements ExceptionInterface { public function __construct(string $message = 'Invalid password.', int $code = 0, ?\Throwable $previous = null) diff --git a/src/Symfony/Component/PasswordHasher/Exception/LogicException.php b/src/Symfony/Component/PasswordHasher/Exception/LogicException.php index a0c425fa6f..f4d9f31ff5 100644 --- a/src/Symfony/Component/PasswordHasher/Exception/LogicException.php +++ b/src/Symfony/Component/PasswordHasher/Exception/LogicException.php @@ -13,7 +13,7 @@ namespace Symfony\Component\PasswordHasher\Exception; /** * @author Robin Chalas -*/ + */ class LogicException extends \LogicException implements ExceptionInterface { } diff --git a/src/Symfony/Component/PasswordHasher/Hasher/MigratingPasswordHasher.php b/src/Symfony/Component/PasswordHasher/Hasher/MigratingPasswordHasher.php index f48373c6e9..0fb91d047b 100644 --- a/src/Symfony/Component/PasswordHasher/Hasher/MigratingPasswordHasher.php +++ b/src/Symfony/Component/PasswordHasher/Hasher/MigratingPasswordHasher.php @@ -12,7 +12,6 @@ namespace Symfony\Component\PasswordHasher\Hasher; use Symfony\Component\PasswordHasher\PasswordHasherInterface; -use Symfony\Component\PasswordHasher\LegacyPasswordHasherInterface; /** * Hashes passwords using the best available hasher. diff --git a/src/Symfony/Component/PasswordHasher/Hasher/PasswordHasherFactoryInterface.php b/src/Symfony/Component/PasswordHasher/Hasher/PasswordHasherFactoryInterface.php index 943a4003da..038c34a318 100644 --- a/src/Symfony/Component/PasswordHasher/Hasher/PasswordHasherFactoryInterface.php +++ b/src/Symfony/Component/PasswordHasher/Hasher/PasswordHasherFactoryInterface.php @@ -11,8 +11,8 @@ namespace Symfony\Component\PasswordHasher\Hasher; -use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\PasswordHasher\PasswordHasherInterface; +use Symfony\Component\Security\Core\User\UserInterface; /** * PasswordHasherFactoryInterface to support different password hashers for different user accounts. diff --git a/src/Symfony/Component/PasswordHasher/Hasher/SodiumPasswordHasher.php b/src/Symfony/Component/PasswordHasher/Hasher/SodiumPasswordHasher.php index 613cccd037..626878815b 100644 --- a/src/Symfony/Component/PasswordHasher/Hasher/SodiumPasswordHasher.php +++ b/src/Symfony/Component/PasswordHasher/Hasher/SodiumPasswordHasher.php @@ -11,8 +11,8 @@ namespace Symfony\Component\PasswordHasher\Hasher; -use Symfony\Component\PasswordHasher\Exception\LogicException; use Symfony\Component\PasswordHasher\Exception\InvalidPasswordException; +use Symfony\Component\PasswordHasher\Exception\LogicException; use Symfony\Component\PasswordHasher\PasswordHasherInterface; /** diff --git a/src/Symfony/Component/PasswordHasher/Tests/Command/UserPasswordHashCommandTest.php b/src/Symfony/Component/PasswordHasher/Tests/Command/UserPasswordHashCommandTest.php index 03cca7acd9..c633e6240f 100644 --- a/src/Symfony/Component/PasswordHasher/Tests/Command/UserPasswordHashCommandTest.php +++ b/src/Symfony/Component/PasswordHasher/Tests/Command/UserPasswordHashCommandTest.php @@ -12,15 +12,14 @@ namespace Symfony\Component\PasswordHasher\Tests\Command; use PHPUnit\Framework\TestCase; -use Symfony\Bundle\SecurityBundle\Command\UserPasswordHasherCommand; use Symfony\Component\Console\Tester\CommandTester; -use Symfony\Component\Security\Core\User\User; use Symfony\Component\PasswordHasher\Command\UserPasswordHashCommand; +use Symfony\Component\PasswordHasher\Hasher\NativePasswordHasher; use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactory; use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterface; -use Symfony\Component\PasswordHasher\Hasher\NativePasswordHasher; use Symfony\Component\PasswordHasher\Hasher\Pbkdf2PasswordHasher; use Symfony\Component\PasswordHasher\Hasher\SodiumPasswordHasher; +use Symfony\Component\Security\Core\User\User; class UserPasswordHashCommandTest extends TestCase { @@ -240,7 +239,7 @@ class UserPasswordHashCommandTest extends TestCase public function testEncodePasswordNoConfigForGivenUserClass() { - $this->expectException('\RuntimeException'); + $this->expectException(\RuntimeException::class); $this->expectExceptionMessage('No password hasher has been configured for account "Foo\Bar\User".'); $this->passwordHasherCommandTester->execute([ @@ -277,7 +276,7 @@ EOTXT public function testThrowsExceptionOnNoConfiguredHashers() { - $this->expectException('RuntimeException'); + $this->expectException(\RuntimeException::class); $this->expectExceptionMessage('There are no configured password hashers for the "security" extension.'); $tester = new CommandTester(new UserPasswordHashCommand($this->getMockBuilder(PasswordHasherFactoryInterface::class)->getMock(), [])); diff --git a/src/Symfony/Component/PasswordHasher/Tests/Hasher/MessageDigestPasswordHasherTest.php b/src/Symfony/Component/PasswordHasher/Tests/Hasher/MessageDigestPasswordHasherTest.php index a6c66aee21..6abcb797b9 100644 --- a/src/Symfony/Component/PasswordHasher/Tests/Hasher/MessageDigestPasswordHasherTest.php +++ b/src/Symfony/Component/PasswordHasher/Tests/Hasher/MessageDigestPasswordHasherTest.php @@ -38,7 +38,7 @@ class MessageDigestPasswordHasherTest extends TestCase public function testHashAlgorithmDoesNotExist() { - $this->expectException('LogicException'); + $this->expectException(\LogicException::class); $hasher = new MessageDigestPasswordHasher('foobar'); $hasher->hash('password', ''); } diff --git a/src/Symfony/Component/PasswordHasher/Tests/Hasher/PasswordHasherFactoryTest.php b/src/Symfony/Component/PasswordHasher/Tests/Hasher/PasswordHasherFactoryTest.php index 6c5205e374..61c17f18f2 100644 --- a/src/Symfony/Component/PasswordHasher/Tests/Hasher/PasswordHasherFactoryTest.php +++ b/src/Symfony/Component/PasswordHasher/Tests/Hasher/PasswordHasherFactoryTest.php @@ -12,11 +12,11 @@ namespace Symfony\Component\PasswordHasher\Tests\Hasher; use PHPUnit\Framework\TestCase; -use Symfony\Component\PasswordHasher\Hasher\PasswordHasherAwareInterface; -use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactory; use Symfony\Component\PasswordHasher\Hasher\MessageDigestPasswordHasher; use Symfony\Component\PasswordHasher\Hasher\MigratingPasswordHasher; use Symfony\Component\PasswordHasher\Hasher\NativePasswordHasher; +use Symfony\Component\PasswordHasher\Hasher\PasswordHasherAwareInterface; +use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactory; use Symfony\Component\PasswordHasher\Hasher\SodiumPasswordHasher; use Symfony\Component\Security\Core\User\User; use Symfony\Component\Security\Core\User\UserInterface; @@ -112,7 +112,7 @@ class PasswordHasherFactoryTest extends TestCase public function testGetInvalidNamedHasherForHasherAware() { - $this->expectException('RuntimeException'); + $this->expectException(\RuntimeException::class); $factory = new PasswordHasherFactory([ HasherAwareUser::class => new MessageDigestPasswordHasher('sha1'), 'hasher_name' => new MessageDigestPasswordHasher('sha256'), diff --git a/src/Symfony/Component/PasswordHasher/Tests/Hasher/Pbkdf2PasswordHasherTest.php b/src/Symfony/Component/PasswordHasher/Tests/Hasher/Pbkdf2PasswordHasherTest.php index 50f9c8d13e..05785b2141 100644 --- a/src/Symfony/Component/PasswordHasher/Tests/Hasher/Pbkdf2PasswordHasherTest.php +++ b/src/Symfony/Component/PasswordHasher/Tests/Hasher/Pbkdf2PasswordHasherTest.php @@ -38,7 +38,7 @@ class Pbkdf2PasswordHasherTest extends TestCase public function testHashAlgorithmDoesNotExist() { - $this->expectException('LogicException'); + $this->expectException(\LogicException::class); $hasher = new Pbkdf2PasswordHasher('foobar'); $hasher->hash('password', ''); } diff --git a/src/Symfony/Component/PasswordHasher/Tests/Hasher/UserPasswordHasherTest.php b/src/Symfony/Component/PasswordHasher/Tests/Hasher/UserPasswordHasherTest.php index 899723f2e4..5aaee750af 100644 --- a/src/Symfony/Component/PasswordHasher/Tests/Hasher/UserPasswordHasherTest.php +++ b/src/Symfony/Component/PasswordHasher/Tests/Hasher/UserPasswordHasherTest.php @@ -12,12 +12,12 @@ namespace Symfony\Component\PasswordHasher\Tests\Hasher; use PHPUnit\Framework\TestCase; -use Symfony\Component\Security\Core\User\UserInterface; -use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterface; use Symfony\Component\PasswordHasher\Hasher\NativePasswordHasher; +use Symfony\Component\PasswordHasher\Hasher\PasswordHasherFactoryInterface; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasher; -use Symfony\Component\Security\Core\User\User; use Symfony\Component\PasswordHasher\PasswordHasherInterface; +use Symfony\Component\Security\Core\User\User; +use Symfony\Component\Security\Core\User\UserInterface; class UserPasswordHasherTest extends TestCase {