Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
10 | public function run(Bootstrap $bootstrap, Filesystem $fs) |
||
11 | { |
||
12 | foreach($fs->listFiles('resources/migrations') as $path) { |
||
13 | list($ym, $filename) = explode('/', $path); |
||
14 | $namespace = date_create_from_format('Ym', $ym)->format('FY'); |
||
15 | $class = $namespace.'\\'.substr($filename, 0, -4); |
||
16 | if(!class_exists($class, false)) { |
||
17 | include $fs->getPath('resources/migrations/'.$path); |
||
18 | } |
||
19 | $bootstrap->register($class); |
||
20 | } |
||
21 | |||
22 | $bootstrap->migrate(); |
||
23 | } |
||
24 | } |