Provided implementation of new client entity methods

This commit is contained in:
Alex Bilbie 2016-02-18 10:48:23 +00:00
parent de000b72a4
commit 7f67000d53

View File

@ -9,8 +9,17 @@ trait ClientEntityTrait
protected $name;
/**
* Get the client's name
* @return string
* @var string
*/
protected $secret;
/**
* @var string
*/
protected $redirectUri;
/**
* @inheritdoc
*/
public function getName()
{
@ -18,11 +27,50 @@ trait ClientEntityTrait
}
/**
* Set the client's name
* @param string $name
* @inheritdoc
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @inheritdoc
*/
public function canKeepASecret()
{
return $this->secret === null;
}
/**
* @inheritdoc
*/
public function setSecret($secret)
{
$this->secret = $secret;
}
/**
* @inheritdoc
*/
public function validateSecret($submittedSecret)
{
return strcmp((string) $submittedSecret, $this->secret) === 0;
}
/**
* @inheritdoc
*/
public function setRedirectUri($redirectUri)
{
$this->redirectUri = $redirectUri;
}
/**
* @inheritdoc
*/
public function getRedirectUri()
{
return $this->redirectUri;
}
}