Definition at line 31 of file Token.php.
◆ __construct()
Constructor; basic setup for any Token subclass.
- Parameters
-
- Returns
- void
Definition at line 67 of file Token.php.
78 if ($utility !==
null) {
79 $this->_httpUtility = $utility;
_parseParameters(Zend_Http_Response $response)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
◆ __get()
Generic accessor to enable access as public properties.
- Returns
- string
Definition at line 206 of file Token.php.
◆ __set()
Generic mutator to enable access as public properties.
- Parameters
-
- Returns
- void
Definition at line 218 of file Token.php.
◆ __sleep()
Limit serialisation stored data to the parameters
Definition at line 271 of file Token.php.
273 return array(
'_params');
◆ __toString()
Convert Token to a string, specifically a raw encoded query string. Aliases to self::toString()
- Returns
- string
Definition at line 239 of file Token.php.
◆ __wakeup()
After serialisation, re-instantiate a HTTP utility class for use
Definition at line 279 of file Token.php.
281 if ($this->_httpUtility ===
null) {
◆ _parseParameters()
Parse a HTTP response body and collect returned parameters as raw url decoded key-value pairs in an associative array.
- Parameters
-
- Returns
- array
Definition at line 251 of file Token.php.
260 $parts = explode(
'&', $body);
261 foreach ($parts as $kvpair) {
262 $pair = explode(
'=', $kvpair);
263 $params[rawurldecode($pair[0])] = rawurldecode($pair[1]);
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
◆ getParam()
Get the value for a parameter (e.g. token secret or other).
- Parameters
-
- Returns
- mixed
Definition at line 171 of file Token.php.
173 if (isset($this->_params[$key])) {
174 return $this->_params[$key];
◆ getResponse()
◆ getToken()
Gets the value for a Token.
- Returns
- string
Definition at line 196 of file Token.php.
198 return $this->
getParam(self::TOKEN_PARAM_KEY);
◆ getTokenSecret()
Retrieve this Token's secret which may be used when signing requests with this Token.
- Returns
- string
Definition at line 131 of file Token.php.
133 return $this->
getParam(self::TOKEN_SECRET_PARAM_KEY);
◆ isValid()
Attempts to validate the Token parsed from the HTTP response - really it's just very basic existence checks which are minimal.
- Returns
- bool
Definition at line 91 of file Token.php.
93 if (isset($this->_params[self::TOKEN_PARAM_KEY])
94 && !empty($this->_params[self::TOKEN_PARAM_KEY])
95 && isset($this->_params[self::TOKEN_SECRET_PARAM_KEY])
◆ setParam()
setParam |
( |
|
$key, |
|
|
|
$value |
|
) |
| |
Sets the value for a parameter (e.g. token secret or other) and run a simple filter to remove any trailing newlines.
- Parameters
-
- Returns
- Zend_Oauth_Token
Definition at line 144 of file Token.php.
146 $this->_params[$key] = trim(
$value,
"\n");
◆ setParams()
setParams |
( |
array |
$params | ) |
|
Sets the value for some parameters (e.g. token secret or other) and run a simple filter to remove any trailing newlines.
- Parameters
-
- Returns
- Zend_Oauth_Token
Definition at line 157 of file Token.php.
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
◆ setToken()
◆ setTokenSecret()
setTokenSecret |
( |
|
$secret | ) |
|
Sets the value for the this Token's secret which may be used when signing requests with this Token.
- Parameters
-
- Returns
- Zend_Oauth_Token
Definition at line 119 of file Token.php.
121 $this->
setParam(self::TOKEN_SECRET_PARAM_KEY, $secret);
◆ toString()
Convert Token to a string, specifically a raw encoded query string.
- Returns
- string
Definition at line 228 of file Token.php.
230 return $this->_httpUtility->toEncodedQueryString($this->_params);
◆ $_httpUtility
◆ $_params
◆ $_response
◆ TOKEN_PARAM_CALLBACK_CONFIRMED
const TOKEN_PARAM_CALLBACK_CONFIRMED = 'oauth_callback_confirmed' |
◆ TOKEN_PARAM_KEY
const TOKEN_PARAM_KEY = 'oauth_token' |
+ Token constants
Definition at line 36 of file Token.php.
◆ TOKEN_SECRET_PARAM_KEY
const TOKEN_SECRET_PARAM_KEY = 'oauth_token_secret' |
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Oauth/Token.php