66
77use Doctrine \ORM \EntityManager ;
88use Doctrine \ORM \EntityManagerInterface ;
9- use Doctrine \ORM \Mapping \EntityListenerResolver ;
9+ use Doctrine \ORM \Mapping \EntityListenerResolver as EntityListenerResolverInterface ;
10+ use Doctrine \Persistence \Mapping \Driver \MappingDriver ;
1011use Doctrine \Persistence \Mapping \Driver \MappingDriverChain ;
1112use Dot \Cache \Adapter \ArrayAdapter ;
1213use Dot \Cache \Adapter \FilesystemAdapter ;
1314use Light \App \Factory \EntityListenerResolverFactory ;
1415use Light \App \Factory \GetIndexViewHandlerFactory ;
1516use Light \App \Handler \GetIndexViewHandler ;
17+ use Light \App \Resolver \EntityListenerResolver ;
1618use Light \App \Types \UuidType ;
1719use Mezzio \Application ;
1820use Roave \PsrContainerDoctrine \EntityManagerFactory ;
1921
22+ use Symfony \Component \Cache \Adapter \AdapterInterface ;
2023use function getcwd ;
2124
25+ /**
26+ * @phpstan-type ConfigType array{
27+ * dependencies: DependenciesType,
28+ * doctrine: DoctrineConfigType,
29+ * }
30+ * @phpstan-type DoctrineConfigType array{
31+ * cache: array{
32+ * array: array{
33+ * class: class-string<AdapterInterface>,
34+ * },
35+ * filesystem: array{
36+ * class: class-string<AdapterInterface>,
37+ * directory: non-empty-string,
38+ * namespace: non-empty-string,
39+ * },
40+ * },
41+ * configuration: array{
42+ * orm_default: array{
43+ * entity_listener_resolver: class-string<EntityListenerResolverInterface>,
44+ * result_cache: non-empty-string,
45+ * metadata_cache: non-empty-string,
46+ * query_cache: non-empty-string,
47+ * hydration_cache: non-empty-string,
48+ * typed_field_mapper: non-empty-string|null,
49+ * second_level_cache: array{
50+ * enabled: bool,
51+ * default_lifetime: int,
52+ * default_lock_lifetime: int,
53+ * file_lock_region_directory: string,
54+ * regions: string[],
55+ * },
56+ * },
57+ * },
58+ * driver: array{
59+ * orm_default: array{
60+ * class: class-string<MappingDriver>,
61+ * },
62+ * },
63+ * migrations: array{
64+ * migrations_paths: array<non-empty-string, non-empty-string>,
65+ * all_or_nothing: bool,
66+ * check_database_platform: bool,
67+ * },
68+ * types: array<non-empty-string, class-string>,
69+ * }
70+ * @phpstan-type DependenciesType array{
71+ * factories: array<class-string|non-empty-string, class-string|non-empty-string>,
72+ * aliases: array<class-string|non-empty-string, class-string|non-empty-string>,
73+ * }
74+ **/
2275class ConfigProvider
2376{
2477 /**
25- @return array{
26- * dependencies: array<mixed>,
27- * templates: array<mixed>,
28- * }
78+ * @return ConfigType
2979 */
3080 public function __invoke (): array
3181 {
@@ -37,10 +87,7 @@ public function __invoke(): array
3787 }
3888
3989 /**
40- * @return array{
41- * delegators: array<class-string, array<class-string>>,
42- * factories: array<class-string, class-string>,
43- * }
90+ * @return DependenciesType
4491 */
4592 public function getDependencies (): array
4693 {
@@ -84,6 +131,9 @@ public function getTemplates(): array
84131 ];
85132 }
86133
134+ /**
135+ * @return DoctrineConfigType
136+ */
87137 private function getDoctrineConfig (): array
88138 {
89139 return [
0 commit comments