66
77use Doctrine \ORM \EntityManager ;
88use Doctrine \ORM \EntityManagerInterface ;
9+ use Doctrine \ORM \Mapping \EntityListenerResolver as EntityListenerResolverInterface ;
10+ use Doctrine \Persistence \Mapping \Driver \MappingDriver ;
911use Doctrine \Persistence \Mapping \Driver \MappingDriverChain ;
1012use Dot \Cache \Adapter \ArrayAdapter ;
1113use Dot \Cache \Adapter \FilesystemAdapter ;
1517use Ramsey \Uuid \Doctrine \UuidType ;
1618use Roave \PsrContainerDoctrine \EntityManagerFactory ;
1719
20+ use Symfony \Component \Cache \Adapter \AdapterInterface ;
1821use function getcwd ;
1922
23+ /**
24+ * @phpstan-type ConfigType array{
25+ * dependencies: DependenciesType,
26+ * doctrine: DoctrineConfigType,
27+ * resultCacheLifetime: int,
28+ * }
29+ * @phpstan-type DoctrineConfigType array{
30+ * cache: array{
31+ * array: array{
32+ * class: class-string<AdapterInterface>,
33+ * },
34+ * filesystem: array{
35+ * class: class-string<AdapterInterface>,
36+ * directory: non-empty-string,
37+ * namespace: non-empty-string,
38+ * },
39+ * },
40+ * configuration: array{
41+ * orm_default: array{
42+ * entity_listener_resolver: class-string<EntityListenerResolverInterface>,
43+ * result_cache: non-empty-string,
44+ * metadata_cache: non-empty-string,
45+ * query_cache: non-empty-string,
46+ * hydration_cache: non-empty-string,
47+ * typed_field_mapper: non-empty-string|null,
48+ * second_level_cache: array{
49+ * enabled: bool,
50+ * default_lifetime: int,
51+ * default_lock_lifetime: int,
52+ * file_lock_region_directory: string,
53+ * regions: non-empty-string[],
54+ * },
55+ * },
56+ * },
57+ * driver: array{
58+ * orm_default: array{
59+ * class: class-string<MappingDriver>,
60+ * },
61+ * },
62+ * fixtures: non-empty-string,
63+ * migrations: array{
64+ * table_storage: array{
65+ * table_name: non-empty-string,
66+ * version_column_name: non-empty-string,
67+ * version_column_length: int,
68+ * executed_at_column_name: non-empty-string,
69+ * execution_time_column_name: non-empty-string,
70+ * },
71+ * migrations_paths: array<non-empty-string, non-empty-string>,
72+ * all_or_nothing: bool,
73+ * check_database_platform: bool,
74+ * },
75+ * types: array<non-empty-string, class-string>,
76+ * }
77+ * @phpstan-type DependenciesType array{
78+ * factories: array<class-string|non-empty-string, class-string|non-empty-string>,
79+ * aliases: array<class-string|non-empty-string, class-string|non-empty-string>,
80+ * }
81+ */
82+
2083class ConfigProvider
2184{
2285 /**
@@ -39,6 +102,7 @@ public function __invoke(): array
39102 * @return array{
40103 * delegators: array<class-string, array<class-string>>,
41104 * factories: array<class-string, class-string>,
105+ * aliases: array<class-string, string>
42106 * }
43107 */
44108 public function getDependencies (): array
@@ -82,6 +146,9 @@ public function getTemplates(): array
82146 ];
83147 }
84148
149+ /**
150+ * @return DoctrineConfigType
151+ */
85152 private function getDoctrineConfig (): array
86153 {
87154 return [
0 commit comments