Conditions | 4 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | public function getMigration($class): MigrationInterface |
||
31 | { |
||
32 | $migration = null; |
||
|
|||
33 | try { |
||
34 | $migration = $this->container->get($class); |
||
35 | if (!$migration || !$migration instanceof MigrationInterface) { |
||
36 | throw new \RuntimeException('Migration must implement ' . MigrationInterface::class); |
||
37 | } |
||
38 | } catch (\Exception $e) { |
||
39 | throw new RuntimeException('Migration instantiate error: ' . $class, 0, $e); |
||
40 | } |
||
41 | return $migration; |
||
42 | } |
||
44 |