From 16d91d4a4e190975300ac290fb7be38e943a5711 Mon Sep 17 00:00:00 2001 From: Tymoteusz Motylewski Date: Fri, 4 Dec 2020 12:00:02 +0100 Subject: [PATCH 1/2] Fix namespace for AuthStore --- src/Shoplo/ShoploApi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Shoplo/ShoploApi.php b/src/Shoplo/ShoploApi.php index 7a3c0c8..29142d6 100755 --- a/src/Shoplo/ShoploApi.php +++ b/src/Shoplo/ShoploApi.php @@ -21,7 +21,7 @@ class ShoploApi private $secret_key; /** - * @var ShoploAuthStore + * @var \Shoplo\AuthStore */ private $auth_store; From 0890b11c0d8163273f4bec4168af0759465eac66 Mon Sep 17 00:00:00 2001 From: Tymoteusz Motylewski Date: Mon, 7 Dec 2020 14:13:59 +0100 Subject: [PATCH 2/2] Improve doc comments in several classes --- src/Shoplo/AuthStore.php | 5 +++++ src/Shoplo/Resource.php | 11 +++++++++++ src/Shoplo/ShoploApi.php | 20 +++++++++++++------- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/Shoplo/AuthStore.php b/src/Shoplo/AuthStore.php index 46c34e3..3a140bd 100644 --- a/src/Shoplo/AuthStore.php +++ b/src/Shoplo/AuthStore.php @@ -4,10 +4,15 @@ class AuthStore { + /** + * @var AuthStoreAbstract|AuthSessionStore + */ static private $instance = false; /** * Request an instance of the OAuthStore + * @param null|AuthStoreAbstract $object + * @return AuthStoreAbstract|AuthSessionStore */ public static function getInstance($object = null, $options = array()) { diff --git a/src/Shoplo/Resource.php b/src/Shoplo/Resource.php index 1f2cf82..4431fd8 100755 --- a/src/Shoplo/Resource.php +++ b/src/Shoplo/Resource.php @@ -6,6 +6,9 @@ class Resource { + /** + * @var \Shoplo\ShoploStoreAdapterInterface + */ protected $client; protected $bucket = array(); protected $prefix = ''; @@ -22,6 +25,10 @@ public function __construct(ShoploStoreAdapterInterface $client, $apiUrl) $this->api_url = $apiUrl; } + /** + * @param array $params + * @return false|string + */ protected function prepare_params($params) { $string = ''; @@ -37,6 +44,10 @@ protected function prepare_params($params) return $string; } + /** + * @param array $result + * @return array + */ protected function prepare_result($result) { if (!is_array($result)) { diff --git a/src/Shoplo/ShoploApi.php b/src/Shoplo/ShoploApi.php index 29142d6..8a1bdca 100755 --- a/src/Shoplo/ShoploApi.php +++ b/src/Shoplo/ShoploApi.php @@ -11,12 +11,12 @@ class ShoploApi { /** - * @var String + * @var string */ private $api_key; /** - * @var String + * @var string */ private $secret_key; @@ -26,17 +26,17 @@ class ShoploApi private $auth_store; /** - * @var String + * @var string */ private $oauth_token; /** - * @var String + * @var string */ private $oauth_token_secret; /** - * @var Boolean + * @var boolean */ public $authorized = false; @@ -173,7 +173,7 @@ class ShoploApi public $api_url; /** - * @var String + * @var string */ public $shop_domain = null; @@ -182,6 +182,9 @@ class ShoploApi */ private $ssoAuthClient; + /** + * @var GuzzleAdapter + */ private $shoploStoreAdapterInterface; public function __construct($config, $authStore = null, $disableSession = false) @@ -221,7 +224,7 @@ public function __construct($config, $authStore = null, $disableSession = false) } /** - * @param $config + * @param array $config */ public function initSSOAuthClient($config) { @@ -238,6 +241,9 @@ public function initSSOAuthClient($config) ); } + /** + * @return string + */ public function getAuthorizeUrl() { return $this->api_url.'/services/oauth/authorize';