| Conditions | 3 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 4.7861 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 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 | |||
| 18 | list($ym, $filename) = explode('/', $path); |
||
| 19 | $namespace = date_create_from_format('Ym', $ym)->format('FY'); |
||
| 20 | |||
| 21 | list($date, $time, $name) = explode('_', substr($filename, 0, -4)); |
||
| 22 | $class = $namespace.'\\'.$name; |
||
| 23 | |||
| 24 | if(!class_exists($class, false)) { |
||
| 25 | include $fs->getPath('resources/migrations/'.$path); |
||
| 26 | } |
||
| 27 | $bootstrap->register($class); |
||
| 28 | } |
||
| 29 | |||
| 30 | 1 | $bootstrap->migrate(); |
|
| 31 | 1 | } |
|
| 32 | } |
||
| 33 |