diff --git a/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php b/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php index 4c7d14f6894e1..ec63c8b62883c 100644 --- a/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php +++ b/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php @@ -29,6 +29,10 @@ * * @author Fabien Potencier * @author Johannes M. Schmitt + * + * @template TUser of UserInterface + * + * @template-implements UserProviderInterface */ class EntityUserProvider implements UserProviderInterface, PasswordUpgraderInterface { diff --git a/src/Symfony/Component/Ldap/Security/LdapUserProvider.php b/src/Symfony/Component/Ldap/Security/LdapUserProvider.php index eef59c28308a3..69b0ecc257a2b 100644 --- a/src/Symfony/Component/Ldap/Security/LdapUserProvider.php +++ b/src/Symfony/Component/Ldap/Security/LdapUserProvider.php @@ -30,6 +30,8 @@ * @author Grégoire Pineau * @author Charles Sarrazin * @author Robin Chalas + * + * @template-implements UserProviderInterface */ class LdapUserProvider implements UserProviderInterface, PasswordUpgraderInterface { diff --git a/src/Symfony/Component/Security/Core/User/AttributesBasedUserProviderInterface.php b/src/Symfony/Component/Security/Core/User/AttributesBasedUserProviderInterface.php index 10cbb434e342e..201f6bc79c379 100644 --- a/src/Symfony/Component/Security/Core/User/AttributesBasedUserProviderInterface.php +++ b/src/Symfony/Component/Security/Core/User/AttributesBasedUserProviderInterface.php @@ -18,6 +18,10 @@ * This is particularly useful with self-contained access tokens. * * @experimental + * + * @template-covariant TUser of UserInterface + * + * @template-extends UserProviderInterface */ interface AttributesBasedUserProviderInterface extends UserProviderInterface { @@ -26,6 +30,8 @@ interface AttributesBasedUserProviderInterface extends UserProviderInterface * * This method must throw UserNotFoundException if the user is not found. * + * @return TUser + * * @throws UserNotFoundException */ public function loadUserByIdentifier(string $identifier, array $attributes = []): UserInterface; diff --git a/src/Symfony/Component/Security/Core/User/ChainUserProvider.php b/src/Symfony/Component/Security/Core/User/ChainUserProvider.php index 47ebbc1a8e339..9bac82d753f04 100644 --- a/src/Symfony/Component/Security/Core/User/ChainUserProvider.php +++ b/src/Symfony/Component/Security/Core/User/ChainUserProvider.php @@ -21,6 +21,8 @@ * handle the request. * * @author Johannes M. Schmitt + * + * @template-implements UserProviderInterface */ class ChainUserProvider implements UserProviderInterface, PasswordUpgraderInterface { diff --git a/src/Symfony/Component/Security/Core/User/InMemoryUserProvider.php b/src/Symfony/Component/Security/Core/User/InMemoryUserProvider.php index e0aef90a14147..07e6cd00bcd9e 100644 --- a/src/Symfony/Component/Security/Core/User/InMemoryUserProvider.php +++ b/src/Symfony/Component/Security/Core/User/InMemoryUserProvider.php @@ -21,6 +21,8 @@ * (a backend with a unique admin for instance) * * @author Fabien Potencier + * + * @template-implements UserProviderInterface */ class InMemoryUserProvider implements UserProviderInterface { diff --git a/src/Symfony/Component/Security/Core/User/MissingUserProvider.php b/src/Symfony/Component/Security/Core/User/MissingUserProvider.php index 4d389ffcf56ca..cf6102aa43313 100644 --- a/src/Symfony/Component/Security/Core/User/MissingUserProvider.php +++ b/src/Symfony/Component/Security/Core/User/MissingUserProvider.php @@ -18,6 +18,8 @@ * when a firewall requires a user provider but none was defined. * * @internal + * + * @template-implements UserProviderInterface */ class MissingUserProvider implements UserProviderInterface { diff --git a/src/Symfony/Component/Security/Core/User/UserProviderInterface.php b/src/Symfony/Component/Security/Core/User/UserProviderInterface.php index ec90d413faafd..0a4d562d61c3e 100644 --- a/src/Symfony/Component/Security/Core/User/UserProviderInterface.php +++ b/src/Symfony/Component/Security/Core/User/UserProviderInterface.php @@ -28,6 +28,8 @@ * information is submitted or what the UserInterface object looks like. * * @author Fabien Potencier + * + * @template-covariant TUser of UserInterface */ interface UserProviderInterface { @@ -41,6 +43,8 @@ interface UserProviderInterface * * @return UserInterface * + * @psalm-return TUser + * * @throws UnsupportedUserException if the user is not supported * @throws UserNotFoundException if the user is not found */ @@ -58,6 +62,8 @@ public function supportsClass(string $class); * * This method must throw UserNotFoundException if the user is not found. * + * @return TUser + * * @throws UserNotFoundException */ public function loadUserByIdentifier(string $identifier): UserInterface;