Skip to content

Commit

Permalink
Adjust the phpDoc deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer authored and bytehead committed Nov 12, 2021
1 parent 365aa32 commit c6a4781
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
6 changes: 4 additions & 2 deletions core-bundle/src/Resources/contao/library/Contao/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,11 @@ public function getRoles()
* @return User
*
* @deprecated Deprecated since Contao 4.13, to be removed in Contao 5.0.
* Use Contao\User::loadUserByIdentifier() instead.
*/
public static function loadUserByUsername($username)
{
trigger_deprecation('contao/core-bundle', '4.13', 'Using "Contao\User::loadUserByUsername()" has been deprecated and will no longer work in Contao 5.0. Use Contao\User::loadUserByIdentifier() instead.');
trigger_deprecation('contao/core-bundle', '4.13', 'Using "Contao\User::loadUserByUsername()" has been deprecated and will no longer work in Contao 5.0. Use "Contao\User::loadUserByIdentifier()" instead.');

return self::loadUserByIdentifier($username);
}
Expand Down Expand Up @@ -507,10 +508,11 @@ public static function loadUserByIdentifier(string $identifier): ?self
* {@inheritdoc}
*
* @deprecated Deprecated since Contao 4.13, to be removed in Contao 5.0.
* Use Contao\User::getUserIdentifier() instead.
*/
public function getUsername()
{
trigger_deprecation('contao/core-bundle', '4.13', 'Using "Contao\User::getUsername()" has been deprecated and will no longer work in Contao 5.0. Use Contao\User::getUserIdentifier() instead.');
trigger_deprecation('contao/core-bundle', '4.13', 'Using "Contao\User::getUsername()" has been deprecated and will no longer work in Contao 5.0. Use "Contao\User::getUserIdentifier()" instead.');

return $this->getUserIdentifier();
}
Expand Down
5 changes: 3 additions & 2 deletions core-bundle/src/Security/User/ContaoUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ public function __construct(ContaoFramework $framework, SessionInterface $sessio
}

/**
* @deprecated Deprecated since Contao 4.13, to be removed in Contao 5.0.
* @deprecated Deprecated since Contao 4.13, to be removed in Contao 5.0;
* use ContaoUserProvider::loadUserByIdentifier() instead
*/
public function loadUserByUsername($username): User
{
trigger_deprecation('contao/core-bundle', '4.13', 'Using "ContaoUserProvider::loadUserByUsername()" has been deprecated and will no longer work in Contao 5.0. Use ContaoUserProvider::loadUserByIdentifier() instead.');
trigger_deprecation('contao/core-bundle', '4.13', 'Using "ContaoUserProvider::loadUserByUsername()" has been deprecated and will no longer work in Contao 5.0. Use "ContaoUserProvider::loadUserByIdentifier()" instead.');

return $this->loadUserByIdentifier($username);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;

/**
* Can't add methods to existing interface, see https://github.com/sebastianbergmann/phpunit/issues/4732.
* @see https://github.com/sebastianbergmann/phpunit/issues/4732
*/
interface ForwardCompatibilityTokenInterface extends TokenInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Symfony\Component\Security\Core\User\UserInterface;

/**
* Can't add methods to existing interface, see https://github.com/sebastianbergmann/phpunit/issues/4732.
* @see https://github.com/sebastianbergmann/phpunit/issues/4732
*/
interface ForwardCompatibilityUserInterface extends UserInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Symfony\Component\Security\Core\User\UserProviderInterface;

/**
* Can't add methods to existing interface, see https://github.com/sebastianbergmann/phpunit/issues/4732.
* @see https://github.com/sebastianbergmann/phpunit/issues/4732
*/
interface ForwardCompatibilityUserProviderInterface extends UserProviderInterface
{
Expand Down

0 comments on commit c6a4781

Please sign in to comment.