Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Shoplo/AuthStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand Down
11 changes: 11 additions & 0 deletions src/Shoplo/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

class Resource
{
/**
* @var \Shoplo\ShoploStoreAdapterInterface
*/
protected $client;
protected $bucket = array();
protected $prefix = '';
Expand All @@ -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 = '';
Expand All @@ -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)) {
Expand Down
22 changes: 14 additions & 8 deletions src/Shoplo/ShoploApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,32 @@
class ShoploApi
{
/**
* @var String
* @var string
*/
private $api_key;

/**
* @var String
* @var string
*/
private $secret_key;

/**
* @var ShoploAuthStore
* @var \Shoplo\AuthStore
*/
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;

Expand Down Expand Up @@ -173,7 +173,7 @@ class ShoploApi
public $api_url;

/**
* @var String
* @var string
*/
public $shop_domain = null;

Expand All @@ -182,6 +182,9 @@ class ShoploApi
*/
private $ssoAuthClient;

/**
* @var GuzzleAdapter
*/
private $shoploStoreAdapterInterface;

public function __construct($config, $authStore = null, $disableSession = false)
Expand Down Expand Up @@ -221,7 +224,7 @@ public function __construct($config, $authStore = null, $disableSession = false)
}

/**
* @param $config
* @param array $config
*/
public function initSSOAuthClient($config)
{
Expand All @@ -238,6 +241,9 @@ public function initSSOAuthClient($config)
);
}

/**
* @return string
*/
public function getAuthorizeUrl()
{
return $this->api_url.'/services/oauth/authorize';
Expand Down