1 | <?php |
||
14 | class OperationConfigurationValidator implements ConfigurationValidatorInterface |
||
15 | { |
||
16 | /** @var RouterInterface */ |
||
17 | protected $router; |
||
18 | |||
19 | /** @var \Twig_ExistsLoaderInterface */ |
||
20 | protected $twigLoader; |
||
21 | |||
22 | /** @var DoctrineHelper */ |
||
23 | protected $doctrineHelper; |
||
24 | |||
25 | /** @var LoggerInterface */ |
||
26 | protected $logger; |
||
27 | |||
28 | /** @var bool */ |
||
29 | protected $debug; |
||
30 | |||
31 | /** @var Collection */ |
||
32 | protected $errors; |
||
33 | |||
34 | /** |
||
35 | * @param RouterInterface $router |
||
36 | * @param \Twig_Loader_Filesystem $twigLoader |
||
37 | * @param DoctrineHelper $doctrineHelper |
||
38 | * @param LoggerInterface $logger |
||
39 | * @param bool $debug |
||
40 | */ |
||
41 | public function __construct( |
||
54 | |||
55 | /** |
||
56 | * @param array $configuration |
||
57 | * @param Collection $errors |
||
58 | */ |
||
59 | public function validate(array $configuration, Collection $errors = null) |
||
71 | |||
72 | /** |
||
73 | * @param array $config |
||
74 | * @param string $path |
||
75 | * @param string $sectionName |
||
76 | */ |
||
77 | protected function validateTemplate(array $config, $path, $sectionName) |
||
88 | |||
89 | /** |
||
90 | * @param array $options |
||
91 | * @param string $path |
||
92 | * @param string $paramName |
||
93 | */ |
||
94 | protected function assertTemplate(array $options, $path, $paramName) |
||
105 | |||
106 | /** |
||
107 | * @param array $config |
||
108 | * @param string $path |
||
109 | */ |
||
110 | protected function validateFormOptions(array $config, $path) |
||
122 | |||
123 | /** |
||
124 | * @param array $config |
||
125 | * @param string $sectionName |
||
126 | * @param string $path |
||
127 | */ |
||
128 | protected function validateFormOptionsAttributes(array $config, $sectionName, $path) |
||
145 | |||
146 | /** |
||
147 | * @param array $items |
||
148 | * @param string $path |
||
149 | */ |
||
150 | protected function validateRoutes(array $items, $path) |
||
164 | |||
165 | /** |
||
166 | * @param array $items |
||
167 | * @param string $path |
||
168 | */ |
||
169 | protected function validateEntities(array $items, $path) |
||
177 | |||
178 | /** |
||
179 | * @param string $entityName |
||
180 | * @return boolean |
||
181 | */ |
||
182 | protected function validateEntity($entityName) |
||
199 | |||
200 | /** |
||
201 | * @param string $path |
||
202 | * @param string $subpath |
||
203 | * @return string |
||
204 | */ |
||
205 | protected function getPath($path, $subpath) |
||
209 | |||
210 | /** |
||
211 | * @param string $path |
||
212 | * @param string $message |
||
213 | * @param mixed $value |
||
214 | * @param bool $silent |
||
215 | * @throws InvalidConfigurationException |
||
216 | */ |
||
217 | protected function handleError($path, $message, $value, $silent = true) |
||
232 | } |
||
233 |
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.