1 | <?php |
||
20 | class Pact |
||
21 | { |
||
22 | /** |
||
23 | * @var MockServerFactory |
||
24 | */ |
||
25 | private $mockServerFactory; |
||
26 | |||
27 | /** |
||
28 | * @var InteractionBuilderFactory |
||
29 | */ |
||
30 | private $interactionBuilderFactory; |
||
31 | |||
32 | /** |
||
33 | * @var |
||
34 | */ |
||
35 | private $mockServerHttpServiceFactory; |
||
36 | |||
37 | |||
38 | /** |
||
39 | * @var InteractionCompositor |
||
40 | */ |
||
41 | private $interactionCompositor; |
||
42 | |||
43 | /** |
||
44 | * @var array |
||
45 | */ |
||
46 | private $config = []; |
||
47 | |||
48 | /** |
||
49 | * @var array |
||
50 | */ |
||
51 | private $providersConfig = []; |
||
52 | |||
53 | /** |
||
54 | * @var string |
||
55 | */ |
||
56 | private $tag; |
||
57 | |||
58 | /** |
||
59 | * @var array |
||
60 | */ |
||
61 | private $servers = []; |
||
62 | |||
63 | /** |
||
64 | * @var array |
||
65 | */ |
||
66 | private $mockServerConfigs = []; |
||
67 | |||
68 | /** |
||
69 | * @var MockServerHttpService[] |
||
70 | */ |
||
71 | private $mockServerHttpServices = []; |
||
72 | |||
73 | /** |
||
74 | * @var array |
||
75 | */ |
||
76 | private $startedServers = []; |
||
77 | |||
78 | /** |
||
79 | * @var array |
||
80 | */ |
||
81 | private $builders = []; |
||
82 | |||
83 | /** |
||
84 | * Pact constructor. |
||
85 | * |
||
86 | * @param MockServerFactory $mockServerFactory |
||
87 | * @param InteractionBuilderFactory $interactionBuilderFactory |
||
88 | * @param InteractionCompositor $interactionCompositor |
||
89 | * @param array $config |
||
90 | * @param array $providersConfig |
||
91 | */ |
||
92 | 8 | public function __construct( |
|
113 | |||
114 | |||
115 | 8 | private function registerMockServerConfigs(): void |
|
121 | |||
122 | 8 | private function registerMockServerHttpServices(): void |
|
128 | |||
129 | 8 | private function registerServers(): void |
|
135 | |||
136 | |||
137 | 8 | private function registerBuilders(): void |
|
143 | |||
144 | /** |
||
145 | * @param array $providerConfig |
||
146 | * |
||
147 | * @return MockServerConfig |
||
148 | */ |
||
149 | 8 | private function createMockServerConfig(array $providerConfig): MockServerConfig |
|
164 | |||
165 | /** |
||
166 | * @param string $consumerVersion |
||
167 | * |
||
168 | * @return bool |
||
169 | */ |
||
170 | 2 | public function finalize(string $consumerVersion): bool |
|
189 | |||
190 | /** |
||
191 | * @param string $providerName |
||
192 | * |
||
193 | * @return string |
||
194 | */ |
||
195 | 1 | private function getPactJson(string $providerName): string |
|
201 | |||
202 | /** |
||
203 | * @param MockServerConfig $config |
||
204 | * @param string $json |
||
205 | * @param string $consumerVersion |
||
206 | */ |
||
207 | 1 | private function publishToBroker(MockServerConfig $config, string $json, string $consumerVersion): void |
|
230 | |||
231 | /** |
||
232 | * @return string |
||
233 | */ |
||
234 | 8 | private function getPactTag(): string |
|
242 | |||
243 | /** |
||
244 | * @return string |
||
245 | */ |
||
246 | 8 | private function getCurrentGitBranch(): string |
|
257 | |||
258 | /** |
||
259 | * @param string $branch |
||
260 | * |
||
261 | * @return string |
||
262 | */ |
||
263 | 8 | private function resolvePactTag(string $branch) |
|
267 | |||
268 | /** |
||
269 | * @param string $providerName |
||
270 | * |
||
271 | * @return int |
||
272 | */ |
||
273 | 3 | public function startServer(string $providerName): int |
|
284 | |||
285 | /** |
||
286 | * @return bool |
||
287 | */ |
||
288 | 1 | public function verifyInteractions(): bool |
|
297 | |||
298 | 1 | public function registerInteraction(InteractionRequestDTO $requestDTO, InteractionResponseDTO $responseDTO, string $providerState): void |
|
311 | |||
312 | /** |
||
313 | * @return string |
||
314 | */ |
||
315 | 1 | public function getConsumerVersion(): string |
|
319 | } |
||
320 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.