[Security/Core] fix merge

This commit is contained in:
Nicolas Grekas 2020-03-13 11:38:56 +01:00
parent 162758317c
commit 228b59da56
4 changed files with 5 additions and 8 deletions

View File

@ -31,7 +31,7 @@ abstract class AbstractToken implements TokenInterface
private $attributes = [];
/**
* @param (Role|string)[] $roles An array of roles
* @param string[] $roles An array of roles
*
* @throws \InvalidArgumentException
*/
@ -41,7 +41,7 @@ abstract class AbstractToken implements TokenInterface
if (\is_string($role)) {
$role = new Role($role, false);
} elseif (!$role instanceof Role) {
throw new \InvalidArgumentException(sprintf('$roles must be an array of strings or Role instances, but got %s.', \gettype($role)));
throw new \InvalidArgumentException(sprintf('$roles must be an array of strings, but got %s.', \gettype($role)));
}
$this->roles[] = $role;

View File

@ -11,7 +11,6 @@
namespace Symfony\Component\Security\Core\Authentication\Token;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Security\Core\User\UserInterface;
/**
@ -26,7 +25,7 @@ class AnonymousToken extends AbstractToken
/**
* @param string $secret A secret used to make sure the token is created by the app and not by a malicious client
* @param string|\Stringable|UserInterface $user
* @param (Role|string)[] $roles
* @param string[] $roles
*/
public function __construct(string $secret, $user, array $roles = [])
{

View File

@ -11,7 +11,6 @@
namespace Symfony\Component\Security\Core\Authentication\Token;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Security\Core\User\UserInterface;
/**
@ -28,7 +27,7 @@ class PreAuthenticatedToken extends AbstractToken
* @param string|\Stringable|UserInterface $user
* @param mixed $credentials
* @param string $providerKey
* @param (Role|string)[] $roles
* @param string[] $roles
*/
public function __construct($user, $credentials, string $providerKey, array $roles = [])
{

View File

@ -11,7 +11,6 @@
namespace Symfony\Component\Security\Core\Authentication\Token;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Security\Core\User\UserInterface;
/**
@ -28,7 +27,7 @@ class UsernamePasswordToken extends AbstractToken
* @param string|\Stringable|UserInterface $user The username (like a nickname, email address, etc.) or a UserInterface instance
* @param mixed $credentials
* @param string $providerKey
* @param (Role|string)[] $roles
* @param string[] $roles
*
* @throws \InvalidArgumentException
*/