diff --git a/src/Security/Core/User/CasUser.php b/src/Security/Core/User/CasUser.php index 7b4679e..a8a2f59 100644 --- a/src/Security/Core/User/CasUser.php +++ b/src/Security/Core/User/CasUser.php @@ -91,7 +91,14 @@ public function getSalt(): ?string */ public function getUser(): string { - return $this->get('user'); + trigger_deprecation( + 'ecphp/cas-bundle', + '2.1.2', + 'The method "%s::getUser()" is deprecated, use %s::getUsername() instead.', + CasUserInterface::class + ); + + return $this->getUsername(); } /** @@ -99,7 +106,7 @@ public function getUser(): string */ public function getUsername(): string { - return $this->getUser(); + return $this->get('user'); } /** diff --git a/src/Security/Core/User/CasUserInterface.php b/src/Security/Core/User/CasUserInterface.php index 181214d..f4c9558 100644 --- a/src/Security/Core/User/CasUserInterface.php +++ b/src/Security/Core/User/CasUserInterface.php @@ -32,5 +32,8 @@ public function getAttributes(): array; public function getPgt(): ?string; + /** + * @deprecated use CasUserInterface::getUsername(); + */ public function getUser(): string; }