Add new NullToken, to satisfy type hint checks when token would otherwise not be set.
This commit is contained in:
parent
af1993ac3a
commit
fce57a4e6e
35
src/GaryJones/OAuth/NullToken.php
Normal file
35
src/GaryJones/OAuth/NullToken.php
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* OAuth
|
||||||
|
*
|
||||||
|
* @package OAuth
|
||||||
|
* @author Andy Smith
|
||||||
|
* @author Gary Jones <gary@garyjones.co.uk>
|
||||||
|
* @license https://raw.github.com/GaryJones/OAuth/master/LICENSE MIT
|
||||||
|
* @link https://github.com/GaryJones/OAuth
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace GaryJones\OAuth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Token holds the properties of a single token.
|
||||||
|
*
|
||||||
|
* This class deals with both temporary (request) and token (access) credntials.
|
||||||
|
*
|
||||||
|
* @package OAuth
|
||||||
|
* @author Gary Jones <gary@garyjones.co.uk>
|
||||||
|
*/
|
||||||
|
class NullToken extends Token
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Constructs a new client object and populates the required parameters.
|
||||||
|
*
|
||||||
|
* @param string $key Client key / identifier.
|
||||||
|
* @param string $secret Client shared-secret.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->setKey('');
|
||||||
|
$this->setSecret('');
|
||||||
|
}
|
||||||
|
}
|
@ -88,7 +88,7 @@ class Server
|
|||||||
$client = $this->getClient($request);
|
$client = $this->getClient($request);
|
||||||
|
|
||||||
// no token required for the initial token request
|
// no token required for the initial token request
|
||||||
$token = null;
|
$token = new NullToken;
|
||||||
|
|
||||||
$this->checkSignature($request, $client, $token);
|
$this->checkSignature($request, $client, $token);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user