Skip to content

Commit 720a51a

Browse files
Merge branch '4.4' into 5.0
* 4.4: [Security/Core] fix merge fix typo [Validator] clarify stringable type annotations [Security/Core] fix some annotations
2 parents a6ba9e9 + aff6ffd commit 720a51a

File tree

4 files changed

+21
-14
lines changed

4 files changed

+21
-14
lines changed

Authentication/Token/AnonymousToken.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Security\Core\Authentication\Token;
1313

14+
use Symfony\Component\Security\Core\User\UserInterface;
15+
1416
/**
1517
* AnonymousToken represents an anonymous token.
1618
*
@@ -21,9 +23,9 @@ class AnonymousToken extends AbstractToken
2123
private $secret;
2224

2325
/**
24-
* @param string $secret A secret used to make sure the token is created by the app and not by a malicious client
25-
* @param string|object $user The user can be a UserInterface instance, or an object implementing a __toString method or the username as a regular string
26-
* @param string[] $roles An array of roles
26+
* @param string $secret A secret used to make sure the token is created by the app and not by a malicious client
27+
* @param string|\Stringable|UserInterface $user
28+
* @param string[] $roles
2729
*/
2830
public function __construct(string $secret, $user, array $roles = [])
2931
{

Authentication/Token/PreAuthenticatedToken.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Security\Core\Authentication\Token;
1313

14+
use Symfony\Component\Security\Core\User\UserInterface;
15+
1416
/**
1517
* PreAuthenticatedToken implements a pre-authenticated token.
1618
*
@@ -22,10 +24,10 @@ class PreAuthenticatedToken extends AbstractToken
2224
private $providerKey;
2325

2426
/**
25-
* @param string|object $user The user can be a UserInterface instance, or an object implementing a __toString method or the username as a regular string
26-
* @param mixed $credentials The user credentials
27-
* @param string $providerKey The provider key
28-
* @param string[] $roles An array of roles
27+
* @param string|\Stringable|UserInterface $user
28+
* @param mixed $credentials
29+
* @param string $providerKey
30+
* @param string[] $roles
2931
*/
3032
public function __construct($user, $credentials, string $providerKey, array $roles = [])
3133
{

Authentication/Token/TokenInterface.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Security\Core\Authentication\Token;
1313

14+
use Symfony\Component\Security\Core\User\UserInterface;
15+
1416
/**
1517
* TokenInterface is the interface for the user authentication information.
1618
*
@@ -45,8 +47,7 @@ public function getCredentials();
4547
/**
4648
* Returns a user representation.
4749
*
48-
* @return string|object Can be a UserInterface instance, an object implementing a __toString method,
49-
* or the username as a regular string
50+
* @return string|\Stringable|UserInterface
5051
*
5152
* @see AbstractToken::setUser()
5253
*/
@@ -58,7 +59,7 @@ public function getUser();
5859
* The user can be a UserInterface instance, or an object implementing
5960
* a __toString method or the username as a regular string.
6061
*
61-
* @param string|object $user The user
62+
* @param string|\Stringable|UserInterface $user
6263
*
6364
* @throws \InvalidArgumentException
6465
*/

Authentication/Token/UsernamePasswordToken.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Security\Core\Authentication\Token;
1313

14+
use Symfony\Component\Security\Core\User\UserInterface;
15+
1416
/**
1517
* UsernamePasswordToken implements a username and password token.
1618
*
@@ -22,10 +24,10 @@ class UsernamePasswordToken extends AbstractToken
2224
private $providerKey;
2325

2426
/**
25-
* @param string|object $user The username (like a nickname, email address, etc.), or a UserInterface instance or an object implementing a __toString method
26-
* @param mixed $credentials This usually is the password of the user
27-
* @param string $providerKey The provider key
28-
* @param string[] $roles An array of roles
27+
* @param string|\Stringable|UserInterface $user The username (like a nickname, email address, etc.) or a UserInterface instance
28+
* @param mixed $credentials
29+
* @param string $providerKey
30+
* @param string[] $roles
2931
*
3032
* @throws \InvalidArgumentException
3133
*/

0 commit comments

Comments
 (0)