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

This commit is contained in:
Hugo Hamon 2012-05-01 13:13:14 +01:00
parent 59dd4df7f4
commit a3ecea3ed3
2 changed files with 10 additions and 1 deletions

View File

@ -75,6 +75,15 @@ abstract class AbstractToken implements TokenInterface
return $this->user;
}
/**
* Sets the user into 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))) {

View File

@ -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