commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
v
w
z
Variables
$
a
d
e
f
g
o
r
s
t
u
•
All
Classes
Namespaces
Functions
Variables
Pages
Loading...
Searching...
No Matches
lib
commercetools-base
src
Client
OAuth2Handler.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Client
;
10
11
use Psr\Cache\CacheItemInterface;
12
use Psr\Cache\CacheItemPoolInterface;
13
use Psr\Http\Message\RequestInterface;
14
15
class
OAuth2Handler
16
{
18
private
$provider;
19
24
public
function
__construct
(
TokenProvider
$provider)
25
{
26
$this->provider = $provider;
27
}
24
public
function
__construct
(
TokenProvider
$provider) {
…
}
28
29
public
function
__invoke
(RequestInterface $request, array $options = []): RequestInterface
30
{
31
return
$request->withHeader(
'Authorization'
, $this->
getAuthorizationHeader
());
32
}
29
public
function
__invoke
(RequestInterface $request, array $options = []): RequestInterface {
…
}
33
34
public
function
getAuthorizationHeader
(): string
35
{
36
return
'Bearer '
. $this->provider->getToken()->getValue();
37
}
34
public
function
getAuthorizationHeader
(): string {
…
}
38
39
public
function
refreshToken
():
Token
40
{
41
return
$this->provider->refreshToken();
42
}
39
public
function
refreshToken
():
Token
{
…
}
43
}
15
class
OAuth2Handler
{
…
};
Commercetools\Client\OAuth2Handler
Definition
OAuth2Handler.php:16
Commercetools\Client\OAuth2Handler\__invoke
__invoke(RequestInterface $request, array $options=[])
Definition
OAuth2Handler.php:29
Commercetools\Client\OAuth2Handler\getAuthorizationHeader
getAuthorizationHeader()
Definition
OAuth2Handler.php:34
Commercetools\Client\OAuth2Handler\refreshToken
refreshToken()
Definition
OAuth2Handler.php:39
Commercetools\Client\OAuth2Handler\__construct
__construct(TokenProvider $provider)
Definition
OAuth2Handler.php:24
Commercetools\Client\Token
Definition
Token.php:16
Commercetools\Client\TokenProvider
Definition
TokenProvider.php:13
Commercetools\Client
Definition
AnonymousFlowTokenProvider.php:5
Generated by
1.9.8