8000 minor #36056 [Security/Core] fix some annotations (nicolas-grekas) · symfony/symfony@f6f19e6 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f6f19e6

Browse files
minor #36056 [Security/Core] fix some annotations (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [Security/Core] fix some annotations | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - `RoleInterface` is deprecated, and we don't document deprecated ways in docblocks/exceptions. Commits ------- 8e873d0 [Security/Core] fix some annotations
2 parents 148b13c + 8e873d0 commit f6f19e6

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed

src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ abstract class AbstractToken implements TokenInterface
3131
private $attributes = [];
3232

3333
/**
34-
* @param (RoleInterface|string)[] $roles An array of roles
34+
* @param (Role|string)[] $roles An array of roles
3535
*
3636
* @throws \InvalidArgumentException
3737
*/
@@ -41,7 +41,7 @@ public function __construct(array $roles = [])
4141
if (\is_string($role)) {
4242
$role = new Role($role);
4343
} elseif (!$role instanceof RoleInterface) {
44-
throw new \InvalidArgumentException(sprintf('$roles must be an array of strings, Role instances or RoleInterface instances, but got %s.', \gettype($role)));
44+
throw new \InvalidArgumentException(sprintf('$roles must be an array of strings, Role instances, but got %s.', \gettype($role)));
4545
}
4646

4747
$this->roles[] = $role;

src/Symfony/Component/Security/Core/Authentication/Token/AnonymousToken.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Security\Core\Authentication\Token;
1313

1414
use Symfony\Component\Security\Core\Role\Role;
15+
use Symfony\Component\Security\Core\User\UserInterface;
1516

1617
/**
1718
* AnonymousToken represents an anonymous token.
@@ -23,9 +24,9 @@ class AnonymousToken extends AbstractToken
2324
private $secret;
2425

2526
/**
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|object $user The user can be a UserInterface in 10000 stance, or an object implementing a __toString method or the username as a regular string
28-
* @param Role[] $roles An array of roles
27+
* @param string $secret A secret used to make sure the token is created by the app and not by a malicious client
28+
* @param string|\Stringable|UserInterface $user
29+
* @param (Role|string)[] $roles
2930
*/
3031
public function __construct($secret, $user, array $roles = [])
3132
{

src/Symfony/Component/Security/Core/Authentication/Token/PreAuthenticatedToken.php

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

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

14-
use Symfony\Component\Security\Core\Role\RoleInterface;
14+
use Symfony\Component\Security\Core\Role\Role;
15+
use Symfony\Component\Security\Core\User\UserInterface;
1516

1617
/**
1718
* PreAuthenticatedToken implements a pre-authenticated token.
@@ -24,10 +25,10 @@ class PreAuthenticatedToken extends AbstractToken
2425
private $providerKey;
2526

2627
/**
27-
* @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
28-
* @param mixed $credentials The user credentials
29-
* @param string $providerKey The provider key
30-
* @param (RoleInterface|string)[] $roles An array of roles
28+
* @param string|\Stringable|UserInterface $user
29+
* @param mixed $credentials
30+
* @param string $providerKey
31+
* @param (Role|string)[] $roles
3132
*/
3233
public function __construct($user, $credentials, $providerKey, array $roles = [])
3334
{

src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Security\Core\Authentication\Token;
1313

1414
use Symfony\Component\Security\Core\Role\RoleInterface;
15+
use Symfony\Component\Security\Core\User\UserInterface;
1516

1617
/**
1718
* TokenInterface is the interface for the user authentication information.
@@ -47,8 +48,7 @@ public function getCredentials();
4748
/**
4849
* Returns a user representation.
4950
*
50-
* @return string|object Can be a UserInterface instance, an object implementing a __toString method,
51-
* or the username as a regular string
51+
* @return string|\Stringable|UserInterface
5252
*
5353
* @see AbstractToken::setUser()
5454
*/
@@ -60,7 +60,7 @@ public function getUser();
6060
* The user can be a UserInterface instance, or an object implementing
6161
* a __toString method or the username as a regular string.
6262
*
63-
* @param string|object $user The user
63+
* @param string|\Stringable|UserInterface $user
6464
*
6565
* @throws \InvalidArgumentException
6666
*/

src/Symfony/Component/Security/Core/Authentication/Token/UsernamePasswordToken.php

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

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

14-
use Symfony\Component\Security\Core\Role\RoleInterface;
14+
use Symfony\Component\Security\Core\Role\Role;
15+
use Symfony\Component\Security\Core\User\UserInterface;
1516

1617
/**
1718
* UsernamePasswordToken implements a username and password token.
@@ -24,10 +25,10 @@ class UsernamePasswordToken extends AbstractToken
2425
private $providerKey;
2526

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

0 commit comments

Comments
 (0)
0