Conditions | 6 |
Paths | 14 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | 64 | public function migrate(Contracts\Manager $manager) |
|
28 | { |
||
29 | 64 | if (!$manager->getSchema()->hasSpace('migrations')) { |
|
30 | 64 | $instance = new Tracker(); |
|
31 | 64 | $instance->migrate($manager); |
|
32 | 64 | } |
|
33 | |||
34 | 64 | foreach ($this->migrations as $migration) { |
|
35 | 3 | $name = is_object($migration) ? get_class($migration) : $migration; |
|
36 | 3 | if (!$manager->get('migrations')->oneByName($name)) { |
|
37 | 3 | $instance = is_object($migration) ? $migration : new $migration(); |
|
38 | 3 | $instance->migrate($manager); |
|
39 | 3 | $manager->create('migrations', $name); |
|
40 | 3 | } |
|
41 | 64 | } |
|
42 | 64 | } |
|
43 | } |
||
44 |