Conditions | 5 |
Paths | 5 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | public function onDispatch(MvcEvent $e) |
||
29 | { |
||
30 | if (!$e->getRequest() instanceof ConsoleRequest) { |
||
31 | throw new RuntimeException('You can only use this action from a console!'); |
||
32 | } |
||
33 | |||
34 | $migrations = $this->migration->getMigrationClasses($e->getRequest()->getParam('all')); |
||
35 | $list = []; |
||
36 | foreach ($migrations as $m) { |
||
37 | $list[] = sprintf("%s %s - %s", $m['applied'] ? '-' : '+', $m['version'], $m['description']); |
||
38 | } |
||
39 | |||
40 | $response = (empty($list) ? 'No migrations available.' : implode("\n", $list)) . "\n"; |
||
41 | |||
42 | $e->setResult($response); |
||
43 | |||
44 | return $response; |
||
45 | } |
||
46 | } |
||
47 |