8000 [Security] Add missing docblock in PreAuthenticatedToken by tgalopin · Pull Request #15481 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Security] Add missing docblock in PreAuthenticatedToken #15481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ abstract class AbstractToken implements TokenInterface
/**
* Constructor.
*
* @param RoleInterface[] $roles An array of roles
* @param RoleInterface[]|string[] $roles An array of roles
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are already some debates about this notation, being incomplete. See #13146 (comment) and other related issues.

As @dosten said in one of them:

getRoles can return an array of strings, Role instances or a mix of both, the phpdoc must reflect that.

*
* @throws \InvalidArgumentException
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

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

use Symfony\Component\Security\Core\Role\RoleInterface;

/**
* PreAuthenticatedToken implements a pre-authenticated token.
*
Expand All @@ -23,6 +25,11 @@ class PreAuthenticatedToken extends AbstractToken

/**
* 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())
{
Expand Down
0