فهرست منبع

[Security] removed type hint in AuthenticationException as the extra information can be of different classes

Fabien Potencier 14 سال پیش
والد
کامیت
d2b184e058

+ 7 - 9
src/Symfony/Component/Security/Exception/AuthenticationException.php

@@ -2,8 +2,6 @@
 
 namespace Symfony\Component\Security\Exception;
 
-use Symfony\Component\Security\Authentication\Token\TokenInterface;
-
 /*
  * This file is part of the Symfony package.
  *
@@ -20,22 +18,22 @@ use Symfony\Component\Security\Authentication\Token\TokenInterface;
  */
 class AuthenticationException extends \RuntimeException
 {
-    protected $token;
+    protected $extraInformation;
 
-    public function __construct($message, TokenInterface $token = null, $code = 0, \Exception $previous = null)
+    public function __construct($message, $extraInformation = null, $code = 0, \Exception $previous = null)
     {
         parent::__construct($message, $code, $previous);
 
-        $this->token = $token;
+        $this->extraInformation = $extraInformation;
     }
 
-    public function getToken()
+    public function getExtraInformation()
     {
-        return $this->token;
+        return $this->extraInformation;
     }
 
-    public function setToken(TokenInterface $token)
+    public function setExtraInformation($extraInformation)
     {
-        $this->token = $token;
+        $this->extraInformation = $extraInformation;
     }
 }

+ 1 - 1
src/Symfony/Component/Security/User/InMemoryUserProvider.php

@@ -30,7 +30,7 @@ class InMemoryUserProvider implements UserProviderInterface
     /**
      * Constructor.
      *
-     * The user array is hash where the keys are usernames and the values are
+     * The user array is a hash where the keys are usernames and the values are
      * an array of attributes: 'password', 'enabled', and 'roles'.
      *
      * @param array $users An array of users