Skip to content

Commit

Permalink
Deprecate EuLoginUser::getUser() method.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jul 23, 2020
1 parent ed78d33 commit 49c12f9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 58 deletions.
1 change: 0 additions & 1 deletion src/DependencyInjection/EuLoginExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class EuLoginExtension extends Extension
{
/**
* @param array<string> $configs
* @param ContainerBuilder $container
*/
public function load(array $configs, ContainerBuilder $container): void
{
Expand Down
13 changes: 9 additions & 4 deletions src/Security/Core/User/EuLoginUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ final class EuLoginUser implements EuLoginUserInterface

/**
* EuLoginUser constructor.
*
* @param \EcPhp\CasBundle\Security\Core\User\CasUserInterface $user
*/
public function __construct(CasUserInterface $user)
{
Expand Down Expand Up @@ -264,14 +262,21 @@ public function getUid(): ?string
*/
public function getUser(): string
{
return $this->user->getUser();
trigger_deprecation(
'ecphp/eu-login-bundle',
'2.2.3',
'The method "%s::getUser()" is deprecated, use %s::getUsername() instead.',
EuLoginUser::class
);

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

/**
* {@inheritdoc}
*/
public function getUsername()
{
return $this->getUser();
return $this->user->getUsername();
}
}
51 changes: 0 additions & 51 deletions src/Security/Core/User/EuLoginUserInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,103 +11,52 @@
*/
interface EuLoginUserInterface extends CasUserInterface
{
/**
* @return string|null
*/
public function getAssuranceLevel(): ?string;

/**
* @return string[]
*/
public function getAuthenticationFactors(): array;

/**
* @return string|null
*/
public function getDepartmentNumber(): ?string;

/**
* @return string|null
*/
public function getDomain(): ?string;

/**
* @return string|null
*/
public function getDomainUsername(): ?string;

/**
* @return string|null
*/
public function getEmail(): ?string;

/**
* @return string|null
*/
public function getEmployeeNumber(): ?string;

/**
* @return string|null
*/
public function getEmployeeType(): ?string;

/**
* @return string|null
*/
public function getFirstName(): ?string;

/**
* @return mixed[]
*/
public function getGroups(): array;

/**
* @return string|null
*/
public function getLastName(): ?string;

/**
* @return string|null
*/
public function getLocale(): ?string;

/**
* @return string|null
*/
public function getLoginDate(): ?string;

/**
* @return string|null
*/
public function getOrgId(): ?string;

/**
* @return string|null
*/
public function getSso(): ?string;

/**
* @return string[]
*/
public function getStrengths(): array;

/**
* @return string|null
*/
public function getTelephoneNumber(): ?string;

/**
* @return string|null
*/
public function getTeleworkingPriority(): ?string;

/**
* @return string|null
*/
public function getTicketType(): ?string;

/**
* @return string|null
*/
public function getUid(): ?string;
}
2 changes: 0 additions & 2 deletions src/Security/Core/User/EuLoginUserProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
interface EuLoginUserProviderInterface extends CasUserProviderInterface
{
/**
* @param ResponseInterface $response
*
* @return CasUserInterface|EuLoginUserInterface
*/
public function loadUserByResponse(ResponseInterface $response): CasUserInterface;
Expand Down

0 comments on commit 49c12f9

Please sign in to comment.