1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* MIT License |
5
|
|
|
* For full license information, please view the LICENSE file that was distributed with this source code. |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
namespace SprykerEco\Client\FactFinderNg\Api\Adapter\Http\Factory; |
9
|
|
|
|
10
|
|
|
use GuzzleHttp\ClientInterface; |
11
|
|
|
use SprykerEco\Client\FactFinderNg\Api\Adapter\FactFinderNgAdapterInterface; |
12
|
|
|
use SprykerEco\Client\FactFinderNg\Api\Adapter\Http\FactFinderNgImportSearchAdapter; |
13
|
|
|
use SprykerEco\Client\FactFinderNg\Api\Adapter\Http\FactFinderNgNavigationAdapter; |
14
|
|
|
use SprykerEco\Client\FactFinderNg\Api\Adapter\Http\FactFinderNgSearchAdapter; |
15
|
|
|
use SprykerEco\Client\FactFinderNg\Api\Adapter\Http\FactFinderNgSuggestAdapter; |
16
|
|
|
use SprykerEco\Client\FactFinderNg\Api\Adapter\Http\FactFinderNgTrackCartAdapter; |
17
|
|
|
use SprykerEco\Client\FactFinderNg\Api\Adapter\Http\FactFinderNgTrackCheckoutAdapter; |
18
|
|
|
use SprykerEco\Client\FactFinderNg\Api\Adapter\Http\FactFinderNgTrackClickAdapter; |
19
|
|
|
use SprykerEco\Client\FactFinderNg\Dependency\Service\FactFinderNgToUtilEncodingServiceInterface; |
20
|
|
|
use SprykerEco\Client\FactFinderNg\FactFinderNgConfig; |
21
|
|
|
|
22
|
|
|
class AdapterFactory implements AdapterFactoryInterface |
23
|
|
|
{ |
24
|
|
|
/** |
25
|
|
|
* @var \GuzzleHttp\ClientInterface |
26
|
|
|
*/ |
27
|
|
|
protected $client; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var \SprykerEco\Client\FactFinderNg\Dependency\Service\FactFinderNgToUtilEncodingServiceInterface |
31
|
|
|
*/ |
32
|
|
|
protected $utilEncodingService; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @var \SprykerEco\Client\FactFinderNg\FactFinderNgConfig |
36
|
|
|
*/ |
37
|
|
|
protected $config; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @param \GuzzleHttp\ClientInterface $client |
41
|
|
|
* @param \SprykerEco\Client\FactFinderNg\Dependency\Service\FactFinderNgToUtilEncodingServiceInterface $utilEncodingService |
42
|
|
|
* @param \SprykerEco\Client\FactFinderNg\FactFinderNgConfig $config |
43
|
|
|
*/ |
44
|
|
|
public function __construct( |
45
|
|
|
ClientInterface $client, |
46
|
|
|
FactFinderNgToUtilEncodingServiceInterface $utilEncodingService, |
47
|
|
|
FactFinderNgConfig $config |
48
|
|
|
) { |
49
|
|
|
$this->config = $config; |
50
|
|
|
$this->client = $client; |
51
|
|
|
$this->utilEncodingService = $utilEncodingService; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @return \SprykerEco\Client\FactFinderNg\Api\Adapter\FactFinderNgAdapterInterface |
56
|
|
|
*/ |
57
|
|
|
public function createFactFinderNgSearchAdapter(): FactFinderNgAdapterInterface |
58
|
|
|
{ |
59
|
|
|
return new FactFinderNgSearchAdapter( |
60
|
|
|
$this->client, |
61
|
|
|
$this->utilEncodingService, |
62
|
|
|
$this->config |
63
|
|
|
); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @return \SprykerEco\Client\FactFinderNg\Api\Adapter\FactFinderNgAdapterInterface |
68
|
|
|
*/ |
69
|
|
|
public function createFactFinderNgSuggestionAdapter(): FactFinderNgAdapterInterface |
70
|
|
|
{ |
71
|
|
|
return new FactFinderNgSuggestAdapter( |
72
|
|
|
$this->client, |
73
|
|
|
$this->utilEncodingService, |
74
|
|
|
$this->config |
75
|
|
|
); |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @return \SprykerEco\Client\FactFinderNg\Api\Adapter\FactFinderNgAdapterInterface |
80
|
|
|
*/ |
81
|
|
|
public function createFactFinderNgNavigationAdapter(): FactFinderNgAdapterInterface |
82
|
|
|
{ |
83
|
|
|
return new FactFinderNgNavigationAdapter( |
84
|
|
|
$this->client, |
85
|
|
|
$this->utilEncodingService, |
86
|
|
|
$this->config |
87
|
|
|
); |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @return \SprykerEco\Client\FactFinderNg\Api\Adapter\FactFinderNgAdapterInterface |
92
|
|
|
*/ |
93
|
|
|
public function createFactFinderImportSearchAdapter(): FactFinderNgAdapterInterface |
94
|
|
|
{ |
95
|
|
|
return new FactFinderNgImportSearchAdapter( |
96
|
|
|
$this->client, |
97
|
|
|
$this->utilEncodingService, |
98
|
|
|
$this->config |
99
|
|
|
); |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @return \SprykerEco\Client\FactFinderNg\Api\Adapter\FactFinderNgAdapterInterface |
104
|
|
|
*/ |
105
|
|
|
public function createFactFinderNgTrackCheckoutApiAdapter(): FactFinderNgAdapterInterface |
106
|
|
|
{ |
107
|
|
|
return new FactFinderNgTrackCheckoutAdapter( |
108
|
|
|
$this->client, |
109
|
|
|
$this->utilEncodingService, |
110
|
|
|
$this->config |
111
|
|
|
); |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* @return \SprykerEco\Client\FactFinderNg\Api\Adapter\FactFinderNgAdapterInterface |
116
|
|
|
*/ |
117
|
|
|
public function createFactFinderNgTrackCartApiAdapter(): FactFinderNgAdapterInterface |
118
|
|
|
{ |
119
|
|
|
return new FactFinderNgTrackCartAdapter( |
120
|
|
|
$this->client, |
121
|
|
|
$this->utilEncodingService, |
122
|
|
|
$this->config |
123
|
|
|
); |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* @return \SprykerEco\Client\FactFinderNg\Api\Adapter\FactFinderNgAdapterInterface |
128
|
|
|
*/ |
129
|
|
|
public function createFactFinderNgTrackClickApiAdapter(): FactFinderNgAdapterInterface |
130
|
|
|
{ |
131
|
|
|
return new FactFinderNgTrackClickAdapter( |
132
|
|
|
$this->client, |
133
|
|
|
$this->utilEncodingService, |
134
|
|
|
$this->config |
135
|
|
|
); |
136
|
|
|
} |
137
|
|
|
} |
138
|
|
|
|