Пример #1
0
 /**
  * execute
  *
  * @param MigrateCommand $command
  * @param callable $next
  *
  * @return mixed
  */
 public function execute($command, callable $next)
 {
     $migration = $command->getMigration();
     if ($migration instanceof OptionsAwareInterface) {
         $migration->setOptions($command->getOptions());
     }
     $next($command);
 }
Пример #2
0
 /**
  * execute
  *
  * @param MigrateCommand $command
  * @param callable $next
  *
  * @return void
  */
 public function execute($command, callable $next)
 {
     $migration = $command->getMigration();
     $direction = $command->getOptions()->getDirection()->isUp() ? 'up' : 'down';
     $migration->{$direction}();
 }