commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
src
Client
ProviderFactory.php
1
<?php
2
3
declare(strict_types=1);
4
5
namespace
Commercetools\Client
;
6
7
use GuzzleHttp\Client;
8
9
class
ProviderFactory
10
{
11
public
function
createTokenStorageProvider
(
12
string
$anonTokenUrl,
13
string
$refreshTokenUrl,
14
ClientCredentials
$credentials,
15
Client $client,
16
TokenStorage
$storage,
17
AnonymousIdProvider
$anonymousIdProvider =
null
18
):
TokenStorageProvider
{
19
$refreshTokenProvider = $this->
createRefreshFlowProvider
($refreshTokenUrl, $credentials, $client, $storage);
20
$anonProvider = $this->
createAnonymousFlowProvider
(
21
$anonTokenUrl,
22
$credentials,
23
$client,
24
$refreshTokenProvider,
25
$anonymousIdProvider
26
);
27
28
return
new
TokenStorageProvider
($storage, $anonProvider);
29
}
30
31
public
function
createPasswordFlowProvider
(
32
string
$passwordTokenUrl,
33
ClientCredentials
$credentials,
34
Client $client,
35
TokenStorage
$storage
36
):
PasswordFlowTokenProvider
{
37
return new
PasswordFlowTokenProvider
($client, $passwordTokenUrl, $credentials, $storage);
38
}
39
40
public
function
createAnonymousFlowProvider
(
41
string
$anonTokenUrl,
42
ClientCredentials
$credentials,
43
Client $client,
44
RefreshFlowTokenProvider
$refreshFlowTokenProvider,
45
AnonymousIdProvider
$anonymousIdProvider =
null
46
):
AnonymousFlowTokenProvider
{
47
return new
AnonymousFlowTokenProvider
(
48
$client,
49
$anonTokenUrl,
50
$credentials,
51
$refreshFlowTokenProvider,
52
$anonymousIdProvider
53
);
54
}
55
56
public
function
createRefreshFlowProvider
(
57
string
$refreshTokenUrl,
58
ClientCredentials
$credentials,
59
Client $client,
60
TokenStorage
$storage
61
):
RefreshFlowTokenProvider
{
62
return new
RefreshFlowTokenProvider
($client, $refreshTokenUrl, $credentials, $storage);
63
}
64
65
public
static
function
of
():
ProviderFactory
66
{
67
return
new
self
();
68
}
69
}
Commercetools\Client\AnonymousFlowTokenProvider
Definition:
AnonymousFlowTokenProvider.php:10
Commercetools\Client\ClientCredentials
Definition:
ClientCredentials.php:16
Commercetools\Client\PasswordFlowTokenProvider
Definition:
PasswordFlowTokenProvider.php:10
Commercetools\Client\ProviderFactory
Definition:
ProviderFactory.php:10
Commercetools\Client\ProviderFactory\createRefreshFlowProvider
createRefreshFlowProvider(string $refreshTokenUrl, ClientCredentials $credentials, Client $client, TokenStorage $storage)
Definition:
ProviderFactory.php:56
Commercetools\Client\ProviderFactory\createTokenStorageProvider
createTokenStorageProvider(string $anonTokenUrl, string $refreshTokenUrl, ClientCredentials $credentials, Client $client, TokenStorage $storage, AnonymousIdProvider $anonymousIdProvider=null)
Definition:
ProviderFactory.php:11
Commercetools\Client\ProviderFactory\of
static of()
Definition:
ProviderFactory.php:65
Commercetools\Client\ProviderFactory\createPasswordFlowProvider
createPasswordFlowProvider(string $passwordTokenUrl, ClientCredentials $credentials, Client $client, TokenStorage $storage)
Definition:
ProviderFactory.php:31
Commercetools\Client\ProviderFactory\createAnonymousFlowProvider
createAnonymousFlowProvider(string $anonTokenUrl, ClientCredentials $credentials, Client $client, RefreshFlowTokenProvider $refreshFlowTokenProvider, AnonymousIdProvider $anonymousIdProvider=null)
Definition:
ProviderFactory.php:40
Commercetools\Client\RefreshFlowTokenProvider
Definition:
RefreshFlowTokenProvider.php:10
Commercetools\Client\TokenStorageProvider
Definition:
TokenStorageProvider.php:8
Commercetools\Client\AnonymousIdProvider
Definition:
AnonymousIdProvider.php:8
Commercetools\Client\TokenStorage
Definition:
TokenStorage.php:8
Commercetools\Client
Definition:
AnonymousFlowTokenProvider.php:5
Generated by
1.9.1