summaryrefslogtreecommitdiffstats
path: root/Core
diff options
context:
space:
mode:
Diffstat (limited to 'Core')
-rw-r--r--Core/Authentication/Token/AbstractToken.php2
-rw-r--r--Core/Authentication/Token/AnonymousToken.php10
-rw-r--r--Core/Authentication/Token/TokenInterface.php4
-rw-r--r--Core/Authentication/Token/UsernamePasswordToken.php18
-rw-r--r--Core/Role/RoleHierarchyInterface.php4
5 files changed, 23 insertions, 15 deletions
diff --git a/Core/Authentication/Token/AbstractToken.php b/Core/Authentication/Token/AbstractToken.php
index ed6e8de..68cbb79 100644
--- a/Core/Authentication/Token/AbstractToken.php
+++ b/Core/Authentication/Token/AbstractToken.php
@@ -33,7 +33,7 @@ abstract class AbstractToken implements TokenInterface
/**
* Constructor.
*
- * @param Role[] $roles An array of roles
+ * @param RoleInterface[] $roles An array of roles
*/
public function __construct(array $roles = array())
{
diff --git a/Core/Authentication/Token/AnonymousToken.php b/Core/Authentication/Token/AnonymousToken.php
index ecdd4cc..9b0a084 100644
--- a/Core/Authentication/Token/AnonymousToken.php
+++ b/Core/Authentication/Token/AnonymousToken.php
@@ -24,9 +24,9 @@ class AnonymousToken extends AbstractToken
/**
* Constructor.
*
- * @param string $key The key shared with the authentication provider
- * @param string $user The user
- * @param Role[] $roles An array of roles
+ * @param string $key The key shared with the authentication provider
+ * @param string $user The user
+ * @param RoleInterface[] $roles An array of roles
*/
public function __construct($key, $user, array $roles = array())
{
@@ -66,9 +66,9 @@ class AnonymousToken extends AbstractToken
/**
* {@inheritDoc}
*/
- public function unserialize($str)
+ public function unserialize($serialized)
{
- list($this->key, $parentStr) = unserialize($str);
+ list($this->key, $parentStr) = unserialize($serialized);
parent::unserialize($parentStr);
}
}
diff --git a/Core/Authentication/Token/TokenInterface.php b/Core/Authentication/Token/TokenInterface.php
index dec31d5..11f69da 100644
--- a/Core/Authentication/Token/TokenInterface.php
+++ b/Core/Authentication/Token/TokenInterface.php
@@ -11,6 +11,8 @@
namespace Symfony\Component\Security\Core\Authentication\Token;
+use Symfony\Component\Security\Core\Role\RoleInterface;
+
/**
* TokenInterface is the interface for the user authentication information.
*
@@ -31,7 +33,7 @@ interface TokenInterface extends \Serializable
/**
* Returns the user roles.
*
- * @return Role[] An array of Role instances.
+ * @return RoleInterface[] An array of RoleInterface instances.
*/
public function getRoles();
diff --git a/Core/Authentication/Token/UsernamePasswordToken.php b/Core/Authentication/Token/UsernamePasswordToken.php
index 95eec54..d6e3998 100644
--- a/Core/Authentication/Token/UsernamePasswordToken.php
+++ b/Core/Authentication/Token/UsernamePasswordToken.php
@@ -24,10 +24,10 @@ class UsernamePasswordToken extends AbstractToken
/**
* Constructor.
*
- * @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
+ * @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 RoleInterface[] $roles An array of roles
*
* @throws \InvalidArgumentException
*/
@@ -78,14 +78,20 @@ class UsernamePasswordToken extends AbstractToken
$this->credentials = null;
}
+ /**
+ * {@inheritdoc}
+ */
public function serialize()
{
return serialize(array($this->credentials, $this->providerKey, parent::serialize()));
}
- public function unserialize($str)
+ /**
+ * {@inheritdoc}
+ */
+ public function unserialize($serialized)
{
- list($this->credentials, $this->providerKey, $parentStr) = unserialize($str);
+ list($this->credentials, $this->providerKey, $parentStr) = unserialize($serialized);
parent::unserialize($parentStr);
}
}
diff --git a/Core/Role/RoleHierarchyInterface.php b/Core/Role/RoleHierarchyInterface.php
index c495a7f..2ea6ca3 100644
--- a/Core/Role/RoleHierarchyInterface.php
+++ b/Core/Role/RoleHierarchyInterface.php
@@ -24,9 +24,9 @@ interface RoleHierarchyInterface
* Reachable roles are the roles directly assigned but also all roles that
* are transitively reachable from them in the role hierarchy.
*
- * @param array $roles An array of directly assigned roles
+ * @param RoleInterface[] $roles An array of directly assigned roles
*
- * @return array An array of all reachable roles
+ * @return RoleInterface[] An array of all reachable roles
*/
public function getReachableRoles(array $roles);
}