diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2012-05-11 18:14:47 +0200 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2012-05-11 18:14:47 +0200 |
commit | 4599d931b04193b23d2cefc87a0bcea92585f071 (patch) | |
tree | 21d2b2c5c942069d61feaa0da1b0cb774cfb6e9e /Core/Authentication/Token/AbstractToken.php | |
parent | 2aa8c9e7601d837c984fb46c2ecb9d1cb653f31e (diff) | |
parent | f4dfadfa0789281be909efb415d69e01342be53d (diff) | |
download | symfony-security-4599d931b04193b23d2cefc87a0bcea92585f071.zip symfony-security-4599d931b04193b23d2cefc87a0bcea92585f071.tar.gz symfony-security-4599d931b04193b23d2cefc87a0bcea92585f071.tar.bz2 |
merged 2.0
Diffstat (limited to 'Core/Authentication/Token/AbstractToken.php')
-rw-r--r-- | Core/Authentication/Token/AbstractToken.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Core/Authentication/Token/AbstractToken.php b/Core/Authentication/Token/AbstractToken.php index 6015799..dc993ba 100644 --- a/Core/Authentication/Token/AbstractToken.php +++ b/Core/Authentication/Token/AbstractToken.php @@ -77,6 +77,15 @@ abstract class AbstractToken implements TokenInterface 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))) { |