Skip to content

Commit

Permalink
Symfony 6 User needs to implement PasswordAuthenticatedUserInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
Zales0123 committed Sep 26, 2022
1 parent d18f050 commit d401b81
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/Core/User/UserInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,22 @@

namespace SyliusLabs\Polyfill\Symfony\Security\Core\User;

use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\UserInterface as SymfonyUserInterface;

// Symfony 5.4
if (\method_exists(SymfonyUserInterface::class, 'getPassword')) {
interface UserInterface extends SymfonyUserInterface
{
}
// Symfony 6
} else {
/**
* @link https://github.com/symfony/symfony/blob/5.3/src/Symfony/Component/Security/Core/User/UserInterface.php
* @link https://github.com/symfony/symfony/blob/6.0/src/Symfony/Component/Security/Core/User/UserInterface.php
* @link https://github.com/symfony/symfony/blob/6.0/src/Symfony/Component/Security/Core/User/PasswordAuthenticatedUserInterface.php
*/
interface UserInterface extends SymfonyUserInterface
interface UserInterface extends SymfonyUserInterface, PasswordAuthenticatedUserInterface
{
/**
* Returns the password used to authenticate the user.
*
* This should be the hashed password. On authentication, a plain-text
* password will be hashed, and then compared to this value.
*
* This method is deprecated since Symfony 5.3, implement it from {@link PasswordAuthenticatedUserInterface} instead.
*
* @return string|null The hashed password if any
*/
public function getPassword();

/**
* Returns the salt that was originally used to hash the password.
*
Expand Down

0 comments on commit d401b81

Please sign in to comment.