Conditions | 7 |
Paths | 7 |
Total Lines | 25 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 7.7656 |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
25 | public function run(Registry $registry): Registry |
||
26 | { |
||
27 | 16 | foreach ($this->getRegistryDbList($registry) as $dbName) { |
|
28 | $reflector = new Reflector(); |
||
29 | 16 | ||
30 | 16 | foreach ($registry as $regEntity) { |
|
31 | if ( |
||
32 | 16 | !$registry->hasTable($regEntity) |
|
33 | || $registry->getDatabase($regEntity) !== $dbName |
||
34 | 16 | || $regEntity->getOptions()->has(self::READONLY_SCHEMA) |
|
35 | 16 | ) { |
|
36 | 16 | continue; |
|
37 | } |
||
38 | |||
39 | $reflector->addTable($registry->getTableSchema($regEntity)); |
||
40 | } |
||
41 | 16 | ||
42 | try { |
||
43 | $reflector->run(); |
||
44 | } catch (\Throwable $e) { |
||
45 | 16 | throw new SyncException($e->getMessage(), (int) $e->getCode(), $e); |
|
46 | } |
||
47 | } |
||
48 | |||
49 | return $registry; |
||
50 | } |
||
70 |