summaryrefslogtreecommitdiffstats
path: root/Authentication
diff options
context:
space:
mode:
Diffstat (limited to 'Authentication')
-rw-r--r--Authentication/Provider/UserAuthenticationProvider.php31
-rw-r--r--Authentication/Token/TokenInterface.php2
-rw-r--r--Authentication/Token/UsernamePasswordToken.php3
3 files changed, 18 insertions, 18 deletions
diff --git a/Authentication/Provider/UserAuthenticationProvider.php b/Authentication/Provider/UserAuthenticationProvider.php
index ddd98c3..17acf2a 100644
--- a/Authentication/Provider/UserAuthenticationProvider.php
+++ b/Authentication/Provider/UserAuthenticationProvider.php
@@ -42,16 +42,6 @@ abstract class UserAuthenticationProvider implements AuthenticationProviderInter
}
/**
- * Does additional checks on the user and token (like validating the credentials).
- *
- * @param AccountInterface $account The retrieved AccountInterface instance
- * @param UsernamePasswordToken $token The UsernamePasswordToken token to be authenticated
- *
- * @throws AuthenticationException if the credentials could not be validated
- */
- abstract protected function checkAuthentication(AccountInterface $account, UsernamePasswordToken $token);
-
- /**
* {@inheritdoc}
*/
public function authenticate(TokenInterface $token)
@@ -89,6 +79,14 @@ abstract class UserAuthenticationProvider implements AuthenticationProviderInter
}
/**
+ * {@inheritdoc}
+ */
+ public function supports(TokenInterface $token)
+ {
+ return $token instanceof UsernamePasswordToken;
+ }
+
+ /**
* Retrieves the user from an implementation-specific location.
*
* @param string $username The username to retrieve
@@ -101,10 +99,13 @@ abstract class UserAuthenticationProvider implements AuthenticationProviderInter
abstract protected function retrieveUser($username, UsernamePasswordToken $token);
/**
- * {@inheritdoc}
+ * Does additional checks on the user and token (like validating the
+ * credentials).
+ *
+ * @param AccountInterface $account The retrieved AccountInterface instance
+ * @param UsernamePasswordToken $token The UsernamePasswordToken token to be authenticated
+ *
+ * @throws AuthenticationException if the credentials could not be validated
*/
- public function supports(TokenInterface $token)
- {
- return $token instanceof UsernamePasswordToken;
- }
+ abstract protected function checkAuthentication(AccountInterface $account, UsernamePasswordToken $token);
}
diff --git a/Authentication/Token/TokenInterface.php b/Authentication/Token/TokenInterface.php
index a56c01d..9dcc820 100644
--- a/Authentication/Token/TokenInterface.php
+++ b/Authentication/Token/TokenInterface.php
@@ -23,7 +23,7 @@ interface TokenInterface extends \Serializable
*
* @return string A string representation
*/
- public function __toString();
+ function __toString();
/**
* Returns the user roles.
diff --git a/Authentication/Token/UsernamePasswordToken.php b/Authentication/Token/UsernamePasswordToken.php
index 5356f8d..ae248e8 100644
--- a/Authentication/Token/UsernamePasswordToken.php
+++ b/Authentication/Token/UsernamePasswordToken.php
@@ -36,8 +36,7 @@ class UsernamePasswordToken extends Token
*/
public function setAuthenticated($isAuthenticated)
{
- if ($isAuthenticated)
- {
+ if ($isAuthenticated) {
throw new \LogicException('Cannot set this token to trusted after instantiation.');
}