| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 4.7861 |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | 1 | public function run(Mapper $mapper, Bootstrap $bootstrap, Filesystem $fs) |
|
| 13 | { |
||
| 14 | 1 | $mapper->getPlugin(Annotation::class)->migrate(); |
|
| 15 | |||
| 16 | 1 | foreach ($fs->listFiles('resources/migrations') as $path) { |
|
| 17 | list($ym, $filename) = explode('/', $path); |
||
| 18 | $namespace = date_create_from_format('Ym', $ym)->format('FY'); |
||
| 19 | |||
| 20 | list($date, $time, $name) = explode('_', substr($filename, 0, -4)); |
||
| 21 | $class = $namespace.'\\'.$name; |
||
| 22 | |||
| 23 | if (!class_exists($class, false)) { |
||
| 24 | include $fs->getPath('resources/migrations/'.$path); |
||
| 25 | } |
||
| 26 | $bootstrap->register($class); |
||
| 27 | } |
||
| 28 | |||
| 29 | 1 | $bootstrap->migrate(); |
|
| 30 | 1 | } |
|
| 31 | } |
||
| 32 |