Skip to content

Commit

Permalink
merged branch hhamon/username_password_token_doc (PR #4172)
Browse files Browse the repository at this point in the history
Commits
-------

9ac8d43 [Security] fixed phpdoc.
a3ecea3 [Security] added some missing phpdoc for AbstractToken::setUser() and UsernamePasswordToken::__construct() methods.

Discussion
----------

Fixes PHPDoc in UsernamePasswordToken and AbstractToken classes

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -
  • Loading branch information
fabpot committed May 1, 2012
2 parents 59dd4df + 9ac8d43 commit 34a0c7a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Expand Up @@ -75,6 +75,15 @@ public function getUser()
return $this->user;
}

/**
* Sets the user in the token.
*
* The user can be a UserInterface instance, or an object implementing
* a __toString method or the username as a regular string.
*
* @param mixed $user The user
* @throws \InvalidArgumentException
*/
public function setUser($user)
{
if (!($user instanceof UserInterface || (is_object($user) && method_exists($user, '__toString')) || is_string($user))) {
Expand Down
Expand Up @@ -24,7 +24,7 @@ class UsernamePasswordToken extends AbstractToken
/**
* Constructor.
*
* @param string $user The username (like a nickname, email address, etc.)
* @param string $user The username (like a nickname, email address, etc.), or a UserInterface instance or an object implementing a __toString method.
* @param string $credentials This usually is the password of the user
* @param string $providerKey The provider key
* @param array $roles An array of roles
Expand Down

0 comments on commit 34a0c7a

Please sign in to comment.