oauth2-server/tests/Stubs/ClientEntity.php

83 lines
1.3 KiB
PHP
Raw Normal View History

2015-04-05 18:33:25 +05:30
<?php
2016-02-20 04:39:39 +05:30
2016-03-15 05:40:47 +05:30
namespace LeagueTests\Stubs;
2015-04-05 18:33:25 +05:30
2016-03-15 05:40:47 +05:30
use League\OAuth2\Server\Entities\Interfaces\ClientEntityInterface;
use League\OAuth2\Server\Entities\Traits\EntityTrait;
class ClientEntity implements ClientEntityInterface
2015-04-05 18:33:25 +05:30
{
2016-03-15 05:40:47 +05:30
use EntityTrait;
2015-04-05 18:33:25 +05:30
/**
* @var string
*/
protected $name;
/**
* @var string
*/
protected $secret;
/**
* @var string
*/
protected $redirectUri;
/**
2016-02-20 04:39:39 +05:30
* {@inheritdoc}
2015-04-05 18:33:25 +05:30
*/
public function getName()
{
return $this->name;
}
/**
2016-02-20 04:39:39 +05:30
* {@inheritdoc}
2015-04-05 18:33:25 +05:30
*/
public function setName($name)
{
$this->name = $name;
}
/**
2016-02-20 04:39:39 +05:30
* {@inheritdoc}
*/
public function canKeepASecret()
{
2016-02-18 17:37:36 +05:30
return $this->secret !== null;
}
/**
2016-02-20 04:39:39 +05:30
* {@inheritdoc}
*/
public function setSecret($secret)
{
$this->secret = $secret;
}
/**
2016-02-20 04:39:39 +05:30
* {@inheritdoc}
*/
public function validateSecret($submittedSecret)
{
return strcmp((string) $submittedSecret, $this->secret) === 0;
}
/**
2016-02-20 04:39:39 +05:30
* {@inheritdoc}
*/
public function setRedirectUri($redirectUri)
{
$this->redirectUri = $redirectUri;
}
/**
2016-02-20 04:39:39 +05:30
* {@inheritdoc}
*/
public function getRedirectUri()
{
return $this->redirectUri;
}
}