1919use TypeLang \Mapper \Runtime \Parser \TypeParserInterface ;
2020use TypeLang \Mapper \Runtime \Repository \TypeRepositoryInterface ;
2121
22+ /**
23+ * @phpstan-type PropertyConfigType array{
24+ * name?: non-empty-string,
25+ * type?: non-empty-string,
26+ * skip?: 'null'|'empty'|non-empty-string|list<'null'|'empty'|non-empty-string>,
27+ * type_error_message?: non-empty-string,
28+ * undefined_error_message?: non-empty-string,
29+ * ...
30+ * }
31+ *
32+ * @phpstan-type ClassDiscriminatorConfigType array{
33+ * field: non-empty-string,
34+ * map: array<non-empty-string, non-empty-string>,
35+ * otherwise?: non-empty-string,
36+ * }
37+ *
38+ * @phpstan-type ClassConfigType array{
39+ * normalize_as_array?: bool,
40+ * discriminator?: ClassDiscriminatorConfigType,
41+ * properties?: array<non-empty-string, non-empty-string|PropertyConfigType>
42+ * }
43+ */
2244abstract class ArrayConfigDriver extends LoadableDriver
2345{
2446 private static ?bool $ supportsSchemaValidation = null ;
@@ -42,22 +64,7 @@ abstract protected function getConfiguration(\ReflectionClass $class): ?array;
4264 /**
4365 * @param \ReflectionClass<object> $class
4466 *
45- * @return array{
46- * normalize_as_array?: bool,
47- * type_error_message?: non-empty-string,
48- * undefined_error_message?: non-empty-string,
49- * discriminator?: array{
50- * field: non-empty-string,
51- * map: array<non-empty-string, non-empty-string>,
52- * otherwise?: non-empty-string,
53- * },
54- * properties?: array<non-empty-string, non-empty-string|array{
55- * name?: non-empty-string,
56- * type?: non-empty-string,
57- * skip?: 'null'|'empty'|non-empty-string|list<'null'|'empty'|non-empty-string>,
58- * ...
59- * }>
60- * }|null
67+ * @return ClassConfigType|null
6168 * @throws \InvalidArgumentException
6269 */
6370 private function getConfigurationAndValidate (\ReflectionClass $ class ): ?array
0 commit comments