1 | <?php |
||
25 | class DataCollector extends BaseDataCollector implements EventSubscriberInterface |
||
26 | { |
||
27 | use ControllerAnnotationExtractorTrait; |
||
28 | |||
29 | public const COLLECTOR_NAME = 'spiechu_symfony_commons.data_collector'; |
||
30 | |||
31 | /** |
||
32 | * @var RouterInterface |
||
33 | */ |
||
34 | protected $router; |
||
35 | |||
36 | /** |
||
37 | * @var Reader |
||
38 | */ |
||
39 | protected $reader; |
||
40 | |||
41 | /** |
||
42 | * @var ControllerResolverInterface |
||
43 | */ |
||
44 | protected $controllerResolver; |
||
45 | |||
46 | /** |
||
47 | * @var DataCollectorExtension |
||
48 | */ |
||
49 | protected $dataCollectorExtension; |
||
50 | |||
51 | /** |
||
52 | * @param RouterInterface $router |
||
53 | * @param Reader $reader |
||
54 | * @param ControllerResolverInterface $controllerResolver |
||
55 | * @param DataCollectorExtension $dataCollectorExtension |
||
56 | */ |
||
57 | 12 | public function __construct( |
|
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | 12 | public function collect(Request $request, Response $response, \Exception $exception = null): void |
|
84 | |||
85 | /** |
||
86 | * {@inheritdoc} |
||
87 | */ |
||
88 | 12 | public function getName(): string |
|
92 | |||
93 | /** |
||
94 | * Forward compatibility with Symfony 3.4. |
||
95 | */ |
||
96 | public function reset(): void |
||
100 | |||
101 | /** |
||
102 | * @return array |
||
103 | */ |
||
104 | public function getGlobalResponseSchemas(): array |
||
108 | |||
109 | /** |
||
110 | * {@inheritdoc} |
||
111 | */ |
||
112 | 6 | public static function getSubscribedEvents(): array |
|
119 | |||
120 | /** |
||
121 | * @param CheckResult $checkResult |
||
122 | */ |
||
123 | 2 | public function onCheckResult(CheckResult $checkResult): void |
|
127 | |||
128 | /** |
||
129 | * @param ApiVersionSetEvent $apiVersionSetEvent |
||
130 | */ |
||
131 | 9 | public function onApiVersionSet(ApiVersionSetEvent $apiVersionSetEvent): void |
|
135 | |||
136 | /** |
||
137 | * @return array |
||
138 | */ |
||
139 | 9 | public function getKnownRouteResponseSchemas(): array |
|
143 | |||
144 | /** |
||
145 | * @return int |
||
146 | */ |
||
147 | 9 | public function getKnownRouteResponseSchemaNumber(): int |
|
157 | |||
158 | /** |
||
159 | * @return int |
||
160 | */ |
||
161 | 9 | public function getAllPotentialErrorsCount(): int |
|
165 | |||
166 | /** |
||
167 | * @return bool |
||
168 | */ |
||
169 | 11 | public function responseWasChecked(): bool |
|
173 | |||
174 | /** |
||
175 | * @return bool |
||
176 | */ |
||
177 | 9 | public function apiVersionWasSet(): bool |
|
181 | |||
182 | /** |
||
183 | * @return null|string |
||
184 | */ |
||
185 | 9 | public function getApiVersion(): ?string |
|
189 | |||
190 | /** |
||
191 | * @return ValidationViolation[] |
||
192 | */ |
||
193 | 9 | public function getValidationErrors(): array |
|
201 | |||
202 | /** |
||
203 | * @return bool |
||
204 | */ |
||
205 | public function isGetMethodWasOverridden(): bool |
||
209 | |||
210 | /** |
||
211 | * @return null|string |
||
212 | */ |
||
213 | public function getGetMethodOverriddenTo(): ?string |
||
217 | |||
218 | 12 | protected function extractRoutesData(): void |
|
251 | |||
252 | /** |
||
253 | * @param string $controllerDefinition |
||
254 | * |
||
255 | * @throws \Exception |
||
256 | * |
||
257 | * @return null|ResponseSchemaValidator |
||
258 | */ |
||
259 | 12 | protected function extractControllerResponseValidator(string $controllerDefinition): ?ResponseSchemaValidator |
|
275 | |||
276 | /** |
||
277 | * @return int |
||
278 | */ |
||
279 | 9 | protected function getGlobalNonExistingSchemaFiles(): int |
|
283 | |||
284 | /** |
||
285 | * {@inheritdoc} |
||
286 | */ |
||
287 | 12 | protected function getAnnotationReader(): Reader |
|
291 | } |
||
292 |