minor #15484 [Security] Add missing docblock in PreAuthenticatedToken (tgalopin)
This PR was merged into the 2.3 branch.
Discussion
----------
[Security] Add missing docblock in PreAuthenticatedToken
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
I noticed the `PreAuthenticatedToken` does not provide any dockblock about its constructor parameters so PHPStorm uses the `AbstractToken` parameters and think I'm using `PreAuthenticatedToken` badly.
This fix it by adding the missing docblock and I also added the string[] possibility for roles in `AbstractToken` as it's present in the code and the exception message.
Commits
-------
1dda0a6
[Security] Add missing docblock in PreAuthenticatedToken
This commit is contained in:
commit
fed77a3d80
@ -33,7 +33,7 @@ abstract class AbstractToken implements TokenInterface
|
|||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param RoleInterface[] $roles An array of roles
|
* @param RoleInterface[]|string[] $roles An array of roles
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\Security\Core\Authentication\Token;
|
namespace Symfony\Component\Security\Core\Authentication\Token;
|
||||||
|
|
||||||
|
use Symfony\Component\Security\Core\Role\RoleInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PreAuthenticatedToken implements a pre-authenticated token.
|
* PreAuthenticatedToken implements a pre-authenticated token.
|
||||||
*
|
*
|
||||||
@ -23,6 +25,11 @@ class PreAuthenticatedToken extends AbstractToken
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param string|object $user The user
|
||||||
|
* @param mixed $credentials The user credentials
|
||||||
|
* @param string $providerKey The provider key
|
||||||
|
* @param RoleInterface[]|string[] $roles An array of roles
|
||||||
*/
|
*/
|
||||||
public function __construct($user, $credentials, $providerKey, array $roles = array())
|
public function __construct($user, $credentials, $providerKey, array $roles = array())
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user