summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominique Bongiraud <doume031@wanadoo.fr>2010-10-23 09:58:54 +0200
committerFabien Potencier <fabien.potencier@gmail.com>2010-10-24 09:55:31 +0200
commite96c4eb4c5c97bdad7d93ce2f666ffedf453572a (patch)
tree92d324c9dc091c2448ba4a80d739cce080025a1f
parent459534e8cca52e07607949922b588b3a33be9f39 (diff)
downloadsymfony-security-e96c4eb4c5c97bdad7d93ce2f666ffedf453572a.zip
symfony-security-e96c4eb4c5c97bdad7d93ce2f666ffedf453572a.tar.gz
symfony-security-e96c4eb4c5c97bdad7d93ce2f666ffedf453572a.tar.bz2
[Security]Fixed CS
-rw-r--r--Authentication/Provider/UserAuthenticationProvider.php31
-rw-r--r--Authentication/Token/TokenInterface.php2
-rw-r--r--Authentication/Token/UsernamePasswordToken.php3
-rw-r--r--Authorization/AccessDecisionManager.php5
-rw-r--r--Role/RoleHierarchyInterface.php2
-rw-r--r--SecurityContext.php4
6 files changed, 24 insertions, 23 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.');
}
diff --git a/Authorization/AccessDecisionManager.php b/Authorization/AccessDecisionManager.php
index 983ad03..4b3cae4 100644
--- a/Authorization/AccessDecisionManager.php
+++ b/Authorization/AccessDecisionManager.php
@@ -23,9 +23,9 @@ use Symfony\Component\Security\Authentication\Token\TokenInterface;
class AccessDecisionManager implements AccessDecisionManagerInterface
{
protected $voters;
+ protected $strategy;
protected $allowIfAllAbstainDecisions;
protected $allowIfEqualGrantedDeniedDecisions;
- protected $strategy;
/**
* Constructor.
@@ -104,7 +104,8 @@ class AccessDecisionManager implements AccessDecisionManagerInterface
/**
* {@inheritdoc}
*/
- public function supportsClass($class) {
+ public function supportsClass($class)
+ {
foreach ($this->voters as $voter) {
if ($voter->supportsClass($class)) {
return true;
diff --git a/Role/RoleHierarchyInterface.php b/Role/RoleHierarchyInterface.php
index 97156d7..7563ab3 100644
--- a/Role/RoleHierarchyInterface.php
+++ b/Role/RoleHierarchyInterface.php
@@ -29,5 +29,5 @@ interface RoleHierarchyInterface
*
* @return array An array of all reachable roles
*/
- public function getReachableRoles(array $roles);
+ function getReachableRoles(array $roles);
}
diff --git a/SecurityContext.php b/SecurityContext.php
index 9bae752..ff0df08 100644
--- a/SecurityContext.php
+++ b/SecurityContext.php
@@ -64,7 +64,7 @@ class SecurityContext
*
* @return TokenInterface|null A TokenInterface instance or null if no authentication information is available
*/
- function getToken()
+ public function getToken()
{
return $this->token;
}
@@ -74,7 +74,7 @@ class SecurityContext
*
* @param TokenInterface $token A TokenInterface token, or null if no further authentication information should be stored
*/
- function setToken(TokenInterface $token = null)
+ public function setToken(TokenInterface $token = null)
{
$this->token = $token;
}