1 | <?php |
||
16 | class SchemaFilesExistenceChecker |
||
17 | { |
||
18 | use ControllerAnnotationExtractorTrait; |
||
19 | |||
20 | /** |
||
21 | * @var Reader |
||
22 | */ |
||
23 | protected $reader; |
||
24 | |||
25 | /** |
||
26 | * @var RouterInterface |
||
27 | */ |
||
28 | protected $router; |
||
29 | |||
30 | /** |
||
31 | * @var ControllerResolverInterface |
||
32 | */ |
||
33 | protected $controllerResolver; |
||
34 | |||
35 | /** |
||
36 | * @var FileLocatorInterface |
||
37 | */ |
||
38 | protected $fileLocator; |
||
39 | |||
40 | /** |
||
41 | * @param Reader $reader |
||
42 | * @param RouterInterface $router |
||
43 | * @param ControllerResolverInterface $controllerResolver |
||
44 | * @param FileLocatorInterface $fileLocator |
||
45 | */ |
||
46 | 6 | public function __construct( |
|
57 | |||
58 | /** |
||
59 | * @throws \LogicException If any of controllers can't be found by controller resolver |
||
60 | * @throws \RuntimeException When any of defined schema files in ResponseSchemaValidator not exist |
||
61 | */ |
||
62 | 6 | public function checkControllerResponseSchemaValidatorFiles(): void |
|
97 | |||
98 | /** |
||
99 | * @param array $schemas |
||
100 | * @return null|string |
||
101 | */ |
||
102 | 4 | protected function checkResponseSchema(array $schemas): ?string |
|
116 | |||
117 | /** |
||
118 | * @param array $corruptedFiles |
||
119 | * @return \RuntimeException |
||
120 | */ |
||
121 | protected function createExceptionFromCorruptedFiles(array $corruptedFiles): \RuntimeException |
||
131 | |||
132 | /** |
||
133 | * {@inheritdoc} |
||
134 | */ |
||
135 | 5 | protected function getAnnotationReader(): Reader |
|
139 | } |
||
140 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.