1 | <?php |
||
21 | class DataCollector extends BaseDataCollector implements EventSubscriberInterface |
||
22 | { |
||
23 | const COLLECTOR_NAME = 'spiechu_symfony_commons.data_collector'; |
||
24 | |||
25 | /** |
||
26 | * @var RouterInterface |
||
27 | */ |
||
28 | protected $router; |
||
29 | |||
30 | /** |
||
31 | * @var Reader |
||
32 | */ |
||
33 | protected $reader; |
||
34 | |||
35 | /** |
||
36 | * @var Container |
||
37 | */ |
||
38 | protected $container; |
||
39 | |||
40 | /** |
||
41 | * @param RouterInterface $router |
||
42 | * @param Reader $reader |
||
43 | * @param Container $container |
||
44 | */ |
||
45 | 8 | public function __construct(RouterInterface $router, Reader $reader, Container $container) |
|
51 | |||
52 | /** |
||
53 | * {@inheritdoc} |
||
54 | */ |
||
55 | 8 | public function collect(Request $request, Response $response, \Exception $exception = null): void |
|
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | 8 | public function getName(): string |
|
71 | |||
72 | /** |
||
73 | * Forward compatibility with Symfony 3.4. |
||
74 | */ |
||
75 | public function reset(): void |
||
79 | |||
80 | /** |
||
81 | * @return array |
||
82 | */ |
||
83 | public function getGlobalResponseSchemas(): array |
||
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | 5 | public static function getSubscribedEvents(): array |
|
98 | |||
99 | /** |
||
100 | * @param CheckResult $checkResult |
||
101 | */ |
||
102 | 1 | public function onCheckResult(CheckResult $checkResult): void |
|
106 | |||
107 | /** |
||
108 | * @param ApiVersionSetEvent $apiVersionSetEvent |
||
109 | */ |
||
110 | 6 | public function onApiVersionSet(ApiVersionSetEvent $apiVersionSetEvent): void |
|
114 | |||
115 | /** |
||
116 | * @return array |
||
117 | */ |
||
118 | public function getKnownResponseSchemas(): array |
||
122 | |||
123 | /** |
||
124 | * @return int |
||
125 | */ |
||
126 | public function getKnownResponseSchemaNumber(): int |
||
136 | |||
137 | /** |
||
138 | * @return bool |
||
139 | */ |
||
140 | 1 | public function responseWasChecked(): bool |
|
144 | |||
145 | /** |
||
146 | * @return bool |
||
147 | */ |
||
148 | 5 | public function apiVersionWasSet(): bool |
|
152 | |||
153 | /** |
||
154 | * @return null|string |
||
155 | */ |
||
156 | 5 | public function getApiVersion(): ?string |
|
160 | |||
161 | /** |
||
162 | * @return ValidationViolation[] |
||
163 | */ |
||
164 | public function getValidationErrors(): array |
||
172 | |||
173 | 8 | protected function extractRoutesData(): void |
|
198 | |||
199 | /** |
||
200 | * @param string $controllerDefinition |
||
201 | * |
||
202 | * @throws \Exception |
||
203 | * |
||
204 | * @return null|ResponseSchemaValidator |
||
205 | */ |
||
206 | 8 | protected function extractControllerResponseValidator(string $controllerDefinition): ?ResponseSchemaValidator |
|
218 | } |
||
219 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.