Skip to content

Commit

Permalink
fix: Add missing methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Nov 12, 2021
1 parent 11ba629 commit 09d24cb
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions src/Security/Core/User/EuLoginUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@
namespace EcPhp\EuLoginBundle\Security\Core\User;

use EcPhp\CasBundle\Security\Core\User\CasUserInterface;
use Symfony\Component\Security\Core\User\UserInterface;

use function array_key_exists;

final class EuLoginUser implements EuLoginUserInterface
{
/**
* @var CasUserInterface
*/
private $user;
private CasUserInterface $user;

public function __construct(CasUserInterface $user)
{
Expand Down Expand Up @@ -258,25 +256,48 @@ public function getUid(): ?string
return $this->user->getAttribute('uid');
}

/**
* @deprecated use getUserIdentifier() instead
*/
public function getUser(): string
{
trigger_deprecation(
'ecphp/eu-login-bundle',
'2.2.3',
'The method "%s::getUser()" is deprecated, use %s::getUsername() instead.',
'The method "%s::getUser()" is deprecated, use %s::getUserIdentifier() instead.',
EuLoginUser::class
);

return $this->user->getUsername();
}

public function getUserIdentifier()
{
return $this->user->getUserIdentifier();
}

public function getUserManager(): ?string
{
return $this->user->getAttribute('userManager');
}

/**
* @deprecated since Symfony 5.3, use getUserIdentifier() instead
*/
public function getUsername()
{
trigger_deprecation(
'ecphp/eu-login-bundle',
'2.3.8',
'The method "%s::getUsername()" is deprecated, use %s::getUserIdentifier() instead.',
EuLoginUser::class
);

return $this->user->getUsername();
}

public function isEqualTo(UserInterface $user)
{
return $this->user->isEqualTo($user);
}
}

0 comments on commit 09d24cb

Please sign in to comment.