Skip to content

[PasswordHasher] Fix: Run 'php-cs-fixer fix' #40182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -36,7 +35,7 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

/**
* @author Robin Chalas <robin.chalas@gmail.com>
*/
*/
class InvalidPasswordException extends \RuntimeException implements ExceptionInterface
{
public function __construct(string $message = 'Invalid password.', int $code = 0, ?\Throwable $previous = null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

/**
* @author Robin Chalas <robin.chalas@gmail.com>
*/
*/
class LogicException extends \LogicException implements ExceptionInterface
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -240,7 +239,7 @@ public function testEncodePasswordSodiumOutput()

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([
Expand Down Expand Up @@ -277,7 +276,7 @@ public function testNonInteractiveEncodePasswordUsesFirstUserClass()

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(), []));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function testHash()

public function testHashAlgorithmDoesNotExist()
{
$this->expectException('LogicException');
$this->expectException(\LogicException::class);
$hasher = new MessageDigestPasswordHasher('foobar');
$hasher->hash('password', '');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -112,7 +112,7 @@ public function testGetNullNamedHasherForHasherAware()

public function testGetInvalidNamedHasherForHasherAware()
{
$this->expectException('RuntimeException');
$this->expectException(\RuntimeException::class);
$factory = new PasswordHasherFactory([
HasherAwareUser::class => new MessageDigestPasswordHasher('sha1'),
'hasher_name' => new MessageDigestPasswordHasher('sha256'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function testHash()

public function testHashAlgorithmDoesNotExist()
{
$this->expectException('LogicException');
$this->expectException(\LogicException::class);
$hasher = new Pbkdf2PasswordHasher('foobar');
$hasher->hash('password', '');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down