explain that a role can be an instance of Role

Only mentioning the RoleInterface seems to be confusing as it is
deprecated since Symfony 3.3.
This commit is contained in:
Christian Flothmann 2017-06-03 10:00:53 +02:00
parent d0aa4d93dd
commit 0068968dcc

View File

@ -43,7 +43,7 @@ abstract class AbstractToken implements TokenInterface
if (is_string($role)) {
$role = new Role($role);
} elseif (!$role instanceof RoleInterface) {
throw new \InvalidArgumentException(sprintf('$roles must be an array of strings, or RoleInterface instances, but got %s.', gettype($role)));
throw new \InvalidArgumentException(sprintf('$roles must be an array of strings, Role instances or RoleInterface instances, but got %s.', gettype($role)));
}
$this->roles[] = $role;