private function check(InputInterface $input, OutputInterface $output) { try { $executedMigrations = $this->manager->executedMigrations(); } catch (DatabaseQueryExecuteException $e) { $executedMigrations = false; if (!$this instanceof InitCommand) { $init = new InitCommand(); $init->setConfig($this->config->getConfiguration()); $init->execute($input, $output); } } if ($executedMigrations !== false && $this instanceof InitCommand) { throw new WrongCommandException('Phoenix was already initialized, run migrate or rollback command now.'); } }