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