Skip to content

Commit

Permalink
Deprecate CasUserInterface::getUser().
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jul 23, 2020
1 parent 2fe5654 commit f559ded
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Security/Core/User/CasUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,22 @@ 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();
}

/**
* {@inheritdoc}
*/
public function getUsername(): string
{
return $this->getUser();
return $this->get('user');
}

/**
Expand Down
3 changes: 3 additions & 0 deletions src/Security/Core/User/CasUserInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ public function getAttributes(): array;

public function getPgt(): ?string;

/**
* @deprecated use CasUserInterface::getUsername();
*/
public function getUser(): string;
}

0 comments on commit f559ded

Please sign in to comment.