|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Mcustiel\Phiremock\Common\Utils\V1; |
|
4
|
|
|
|
|
5
|
|
|
use Mcustiel\Phiremock\Common\Utils\ArrayToExpectationConverter as ArrayToExpectationConverterInterface; |
|
6
|
|
|
use Mcustiel\Phiremock\Common\Utils\ArrayToRequestConditionConverter as ArrayToRequestConditionConverterInterface; |
|
7
|
|
|
use Mcustiel\Phiremock\Common\Utils\ArrayToResponseConverter as ArrayToResponseConverterInterface; |
|
8
|
|
|
use Mcustiel\Phiremock\Common\Utils\ArrayToScenarioStateInfoConverter as ArrayToScenarioStateInfoConverterInterface; |
|
9
|
|
|
use Mcustiel\Phiremock\Common\Utils\ArrayToStateConditionsConverter as ArrayToStateConditionsConverterInterface; |
|
10
|
|
|
use Mcustiel\Phiremock\Common\Utils\ExpectationToArrayConverter as ExpectationToArrayConverterInterface; |
|
11
|
|
|
use Mcustiel\Phiremock\Common\Utils\RequestConditionToArrayConverter as RequestConditionToArrayConverterInterface; |
|
12
|
|
|
use Mcustiel\Phiremock\Common\Utils\ResponseToArrayConverter as ResponseToArrayConverterInterface; |
|
13
|
|
|
use Mcustiel\Phiremock\Common\Utils\ScenarioStateInfoToArrayConverter as ScenarioStateInfoToArrayConverterInterface; |
|
14
|
|
|
use Mcustiel\Phiremock\Common\UtilsFactory; |
|
15
|
|
|
|
|
16
|
|
|
class Factory implements UtilsFactory |
|
17
|
|
|
{ |
|
18
|
9 |
|
public function createArrayToExpectationConverter(): ArrayToExpectationConverterInterface |
|
19
|
|
|
{ |
|
20
|
9 |
|
return new ArrayToExpectationConverter( |
|
21
|
9 |
|
$this->createArrayToRequestConditionConverter(), |
|
22
|
9 |
|
$this->createArrayToResponseConverterLocator() |
|
23
|
|
|
); |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
public function createArrayToStateConditionsConverter(): ArrayToStateConditionsConverterInterface |
|
27
|
|
|
{ |
|
28
|
|
|
return new ArrayToStateConditionsConverter(); |
|
29
|
|
|
} |
|
30
|
|
|
|
|
31
|
9 |
|
public function createArrayToResponseConverterLocator(): ArrayToResponseConverterLocator |
|
32
|
|
|
{ |
|
33
|
9 |
|
return new ArrayToResponseConverterLocator($this); |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
9 |
|
public function createArrayToHttpResponseConverter(): ArrayToResponseConverterInterface |
|
37
|
|
|
{ |
|
38
|
9 |
|
return new ArrayToHttpResponseConverter(); |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
public function createArrayToProxyResponseConverter(): ArrayToResponseConverterInterface |
|
42
|
|
|
{ |
|
43
|
|
|
return new ArrayToProxyResponseConverter(); |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
9 |
|
public function createArrayToRequestConditionConverter(): ArrayToRequestConditionConverterInterface |
|
47
|
|
|
{ |
|
48
|
9 |
|
return new ArrayToRequestConditionConverter(); |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
9 |
|
public function createExpectationToArrayConverter(): ExpectationToArrayConverterInterface |
|
52
|
|
|
{ |
|
53
|
9 |
|
return new ExpectationToArrayConverter( |
|
54
|
9 |
|
$this->createRequestConditionToArrayConverter(), |
|
55
|
9 |
|
$this->createResponseToArrayConverterLocator() |
|
56
|
|
|
); |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
9 |
|
public function createHttpResponseToArrayConverter(): ResponseToArrayConverterInterface |
|
60
|
|
|
{ |
|
61
|
9 |
|
return new HttpResponseToArrayConverter(); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
public function createProxyResponseToArrayConverter(): ResponseToArrayConverterInterface |
|
65
|
|
|
{ |
|
66
|
|
|
return new ProxyResponseToArrayConverter(); |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
9 |
|
public function createResponseToArrayConverterLocator(): ResponseToArrayConverterLocator |
|
70
|
|
|
{ |
|
71
|
9 |
|
return new ResponseToArrayConverterLocator($this); |
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
9 |
|
public function createRequestConditionToArrayConverter(): RequestConditionToArrayConverterInterface |
|
75
|
|
|
{ |
|
76
|
9 |
|
return new RequestConditionToArrayConverter(); |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
public function createArrayToScenarioStateInfoConverter(): ArrayToScenarioStateInfoConverterInterface |
|
80
|
|
|
{ |
|
81
|
|
|
return new ArrayToScenarioStateInfoConverter(); |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
public function createScenarioStateInfoToArrayConverter(): ScenarioStateInfoToArrayConverterInterface |
|
85
|
|
|
{ |
|
86
|
|
|
return new ScenarioStateInfoToArrayConverter(); |
|
87
|
|
|
} |
|
88
|
|
|
} |
|
89
|
|
|
|