From c471cd2b8d9988f301754ddd9858d3e98ee53d18 Mon Sep 17 00:00:00 2001 From: Jacob Kiers Date: Fri, 8 Feb 2013 10:37:21 +0000 Subject: [PATCH] Renamed DataStore to DataStoreInterface Also, the Interface now contains comments on the expected return values. --- .../OAuth/{DataStore.php => DataStoreInterface.php} | 12 +++++++++++- src/JacobKiers/OAuth/Server.php | 6 +++--- 2 files changed, 14 insertions(+), 4 deletions(-) rename src/JacobKiers/OAuth/{DataStore.php => DataStoreInterface.php} (89%) diff --git a/src/JacobKiers/OAuth/DataStore.php b/src/JacobKiers/OAuth/DataStoreInterface.php similarity index 89% rename from src/JacobKiers/OAuth/DataStore.php rename to src/JacobKiers/OAuth/DataStoreInterface.php index 659870e..b201a41 100644 --- a/src/JacobKiers/OAuth/DataStore.php +++ b/src/JacobKiers/OAuth/DataStoreInterface.php @@ -18,12 +18,14 @@ namespace JacobKiers\OAuth; * @package OAuth * @author Gary Jones */ -interface DataStore +interface DataStoreInterface { /** * Validate the client. * * @param string $client_key + * + * @return JacobKiers\OAuth\Client */ public function lookupClient($client_key); @@ -33,6 +35,8 @@ interface DataStore * @param JacobKiers\OAuth\Client $client * @param JacobKiers\OAuth\Token $token * @param string $token_type Request or access token + * + * @return JacobKiers\OAuth\Token */ public function lookupToken(Client $client, Token $token, $token_type); @@ -43,6 +47,8 @@ interface DataStore * @param JacobKiers\OAuth\Token $token * @param string $nonce * @param int $timestamp + * + * @return boolean */ public function lookupNonce(Client $client, Token $token, $nonce, $timestamp); @@ -51,6 +57,8 @@ interface DataStore * * @param JacobKiers\OAuth\Client $client * @param string $callback URI to store as the post-authorization callback. + * + * @return JacobKiers\OAuth\Token */ public function newRequestToken(Client $client, $callback = null); @@ -63,6 +71,8 @@ interface DataStore * @param JacobKiers\OAuth\Client $client * @param JacobKiers\OAuth\Token $token * @param string $verifier + * + * @return JacobKiers\OAuth\Token */ public function newAccessToken(Client $client, Token $token, $verifier = null); } diff --git a/src/JacobKiers/OAuth/Server.php b/src/JacobKiers/OAuth/Server.php index 53575b6..077a710 100644 --- a/src/JacobKiers/OAuth/Server.php +++ b/src/JacobKiers/OAuth/Server.php @@ -45,16 +45,16 @@ class Server /** * Data store object reference. * - * @var JacobKiers\OAuth\DataStore + * @var JacobKiers\OAuth\DataStoreInterface */ protected $data_store; /** * Construct OAuth server instance. * - * @param JacobKiers\OAuth\DataStore $data_store + * @param JacobKiers\OAuth\DataStoreInterface $data_store */ - public function __construct(DataStore $data_store) + public function __construct(DataStoreInterface $data_store) { $this->data_store = $data_store; }