1 | <?php |
||
23 | class DataCollector extends BaseDataCollector implements EventSubscriberInterface |
||
24 | { |
||
25 | use ControllerAnnotationExtractorTrait; |
||
26 | |||
27 | public const COLLECTOR_NAME = 'spiechu_symfony_commons.data_collector'; |
||
28 | |||
29 | /** |
||
30 | * @var RouterInterface |
||
31 | */ |
||
32 | protected $router; |
||
33 | |||
34 | /** |
||
35 | * @var Reader |
||
36 | */ |
||
37 | protected $reader; |
||
38 | |||
39 | /** |
||
40 | * @var ControllerResolverInterface |
||
41 | */ |
||
42 | protected $controllerResolver; |
||
43 | |||
44 | /** |
||
45 | * @param RouterInterface $router |
||
46 | * @param Reader $reader |
||
47 | * @param ControllerResolverInterface $controllerResolver |
||
48 | */ |
||
49 | 12 | public function __construct( |
|
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | 12 | public function collect(Request $request, Response $response, \Exception $exception = null): void |
|
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | 12 | public function getName(): string |
|
78 | |||
79 | /** |
||
80 | * Forward compatibility with Symfony 3.4. |
||
81 | */ |
||
82 | public function reset(): void |
||
86 | |||
87 | /** |
||
88 | * @return array |
||
89 | */ |
||
90 | public function getGlobalResponseSchemas(): array |
||
94 | |||
95 | /** |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | 6 | public static function getSubscribedEvents(): array |
|
105 | |||
106 | /** |
||
107 | * @param CheckResult $checkResult |
||
108 | */ |
||
109 | 2 | public function onCheckResult(CheckResult $checkResult): void |
|
113 | |||
114 | /** |
||
115 | * @param ApiVersionSetEvent $apiVersionSetEvent |
||
116 | */ |
||
117 | 9 | public function onApiVersionSet(ApiVersionSetEvent $apiVersionSetEvent): void |
|
121 | |||
122 | /** |
||
123 | * @return array |
||
124 | */ |
||
125 | public function getKnownResponseSchemas(): array |
||
129 | |||
130 | /** |
||
131 | * @return int |
||
132 | */ |
||
133 | public function getKnownResponseSchemaNumber(): int |
||
143 | |||
144 | /** |
||
145 | * @return bool |
||
146 | */ |
||
147 | 2 | public function responseWasChecked(): bool |
|
151 | |||
152 | /** |
||
153 | * @return bool |
||
154 | */ |
||
155 | 5 | public function apiVersionWasSet(): bool |
|
159 | |||
160 | /** |
||
161 | * @return null|string |
||
162 | */ |
||
163 | 5 | public function getApiVersion(): ?string |
|
167 | |||
168 | /** |
||
169 | * @return ValidationViolation[] |
||
170 | */ |
||
171 | public function getValidationErrors(): array |
||
179 | |||
180 | 12 | protected function extractRoutesData(): void |
|
202 | |||
203 | /** |
||
204 | * @param string $controllerDefinition |
||
205 | * |
||
206 | * @throws \Exception |
||
207 | * |
||
208 | * @return null|ResponseSchemaValidator |
||
209 | */ |
||
210 | 12 | protected function extractControllerResponseValidator(string $controllerDefinition): ?ResponseSchemaValidator |
|
226 | |||
227 | /** |
||
228 | * {@inheritdoc} |
||
229 | */ |
||
230 | 12 | protected function getAnnotationReader(): Reader |
|
234 | } |
||
235 |