Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public function getConnectionManager(string $module, string $path): array { |
||
19 | $modulePath = str_replace(CORE_DIR . DIRECTORY_SEPARATOR, '', $path . $module); |
||
20 | $generatorConfig = $this->getConfigGenerator($modulePath); |
||
21 | |||
22 | $manager = new MigrationManager(); |
||
23 | $manager->setGeneratorConfig($generatorConfig); |
||
24 | $manager->setSchemas($this->getSchemas( |
||
25 | $generatorConfig->getSection('paths')['schemaDir'], |
||
26 | $generatorConfig->getSection('generator')['recursive']) |
||
27 | ); |
||
28 | $connections = $generatorConfig->getBuildConnections(); |
||
29 | $manager->setConnections($connections); |
||
30 | $manager->setMigrationTable($generatorConfig->getConfigProperty('migrations.tableName')); |
||
|
|||
31 | $manager->setWorkingDirectory($generatorConfig->getSection('paths')['migrationDir']); |
||
32 | return [$manager, $generatorConfig]; |
||
33 | } |
||
35 |