Lotsa bug fixes and updates

This commit is contained in:
Alex Bilbie
2014-07-11 18:27:03 +01:00
parent c6bc1b0cfc
commit 1e78f62823
17 changed files with 61 additions and 121 deletions

View File

@@ -21,10 +21,10 @@ use Symfony\Component\HttpFoundation\ParameterBag;
abstract class AbstractTokenEntity
{
/**
* Access token ID
* Token identifier
* @var string
*/
protected $token;
protected $id;
/**
* Associated session
@@ -34,9 +34,9 @@ abstract class AbstractTokenEntity
/**
* Session scopes
* @var \Symfony\Component\HttpFoundation\ParameterBag
* @var array Array of ScopeEntity
*/
protected $scopes;
protected $scopes = [];
/**
* Token expire time
@@ -96,13 +96,13 @@ abstract class AbstractTokenEntity
}
/**
* Set access token ID
* Set token ID
* @param string $token Token ID
* @return self
*/
public function setToken($token = null)
public function setId($id = null)
{
$this->token = ($token !== null) ? $token : SecureKey::generate();
$this->id = ($id !== null) ? $id : SecureKey::generate();
return $this;
}
@@ -111,9 +111,9 @@ abstract class AbstractTokenEntity
* Get the token ID
* @return string
*/
public function getToken()
public function getId()
{
return $this->token;
return $this->id;
}
/**
@@ -153,10 +153,10 @@ abstract class AbstractTokenEntity
*/
public function __toString()
{
if ($this->token === null) {
if ($this->id === null) {
return '';
}
return $this->token;
return $this->id;
}
/**