@@ -55,7 +55,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
5555
5656 $ migrations = $ this ->getMigrations ();
5757 $ versions = $ this ->getAdapter ()->fetchAll ();
58-
58+
5959 $ version = $ input ->getOption ('target ' );
6060
6161 ksort ($ migrations );
@@ -64,9 +64,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
6464 // Check we have at least 1 migration to revert
6565 if (empty ($ versions ) || $ version == end ($ versions )) {
6666 $ output ->writeln ("<error>No migrations to rollback</error> " );
67- return ;
67+ return 0 ;
6868 }
69-
69+
7070 // If no target version was supplied, revert the last migration
7171 if (null === $ version ) {
7272 // Get the migration before the last run migration
@@ -75,17 +75,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
7575 } else {
7676 // Get the first migration number
7777 $ first = reset ($ versions );
78-
78+
7979 // If the target version is before the first migration, revert all migrations
8080 if ($ version < $ first ) {
8181 $ version = 0 ;
8282 }
8383 }
84-
84+
8585 // Check the target version exists
8686 if (0 !== $ version && !isset ($ migrations [$ version ])) {
8787 $ output ->writeln ("<error>Target version ( $ version) not found</error> " );
88- return ;
88+ return 0 ;
8989 }
9090
9191 // Revert the migration(s)
@@ -100,5 +100,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
100100 $ container ['phpmig.migrator ' ]->down ($ migration );
101101 }
102102 }
103+
104+ return 0 ;
103105 }
104106}
0 commit comments