1 | <?php |
||
16 | final class Configuration |
||
17 | { |
||
18 | public const VERSIONS_ORGANIZATION_BY_YEAR = 'year'; |
||
19 | public const VERSIONS_ORGANIZATION_BY_YEAR_AND_MONTH = 'year_and_month'; |
||
20 | |||
21 | /** @var array<string, string> */ |
||
22 | private $migrationsDirectories = []; |
||
23 | |||
24 | /** @var string[] */ |
||
25 | private $migrationClasses = []; |
||
26 | |||
27 | /** @var bool */ |
||
28 | private $migrationsAreOrganizedByYear = false; |
||
29 | |||
30 | /** @var bool */ |
||
31 | private $migrationsAreOrganizedByYearAndMonth = false; |
||
32 | |||
33 | /** @var string|null */ |
||
34 | private $customTemplate; |
||
35 | |||
36 | /** @var bool */ |
||
37 | private $isDryRun = false; |
||
38 | |||
39 | /** @var bool */ |
||
40 | private $allOrNothing = false; |
||
41 | |||
42 | /** @var bool */ |
||
43 | private $checkDbPlatform = true; |
||
44 | |||
45 | /** @var MetadataStorageConfiguration */ |
||
46 | private $metadataStorageConfiguration; |
||
47 | |||
48 | /** @var bool */ |
||
49 | private $frozen = false; |
||
50 | |||
51 | 70 | public function freeze() : void |
|
55 | |||
56 | 140 | private function assertNotFrozen() : void |
|
62 | |||
63 | 97 | public function setMetadataStorageConfiguration(MetadataStorageConfiguration $metadataStorageConfiguration) : void |
|
68 | |||
69 | /** |
||
70 | * @return string[] |
||
71 | */ |
||
72 | 44 | public function getMigrationClasses() : array |
|
76 | |||
77 | 10 | public function addMigrationClass(string $className) : void |
|
82 | |||
83 | 66 | public function getMetadataStorageConfiguration() : ?MetadataStorageConfiguration |
|
87 | |||
88 | 91 | public function addMigrationsDirectory(string $namespace, string $path) : void |
|
93 | |||
94 | /** |
||
95 | * @return array<string,string> |
||
96 | */ |
||
97 | 59 | public function getMigrationDirectories() : array |
|
101 | |||
102 | 10 | public function setCustomTemplate(?string $customTemplate) : void |
|
107 | |||
108 | 12 | public function getCustomTemplate() : ?string |
|
112 | |||
113 | 58 | public function areMigrationsOrganizedByYear() : bool |
|
117 | |||
118 | /** |
||
119 | * @throws MigrationException |
||
120 | */ |
||
121 | 7 | public function setMigrationsAreOrganizedByYear( |
|
127 | |||
128 | /** |
||
129 | * @throws MigrationException |
||
130 | */ |
||
131 | 7 | public function setMigrationsAreOrganizedByYearAndMonth( |
|
138 | |||
139 | 56 | public function areMigrationsOrganizedByYearAndMonth() : bool |
|
143 | |||
144 | 1 | public function setIsDryRun(bool $isDryRun) : void |
|
149 | |||
150 | 1 | public function isDryRun() : bool |
|
154 | |||
155 | 11 | public function setAllOrNothing(bool $allOrNothing) : void |
|
160 | |||
161 | 10 | public function isAllOrNothing() : bool |
|
165 | |||
166 | 11 | public function setCheckDatabasePlatform(bool $checkDbPlatform) : void |
|
170 | |||
171 | 3 | public function isDatabasePlatformChecked() : bool |
|
175 | |||
176 | 14 | public function setMigrationOrganization(string $migrationOrganization) : void |
|
187 | } |
||
188 |