/** * @see \Sdc\AppBundle\Command\Command::execute() */ protected function execute(InputInterface $input, OutputInterface $output) { parent::execute($input, $output); $start = new \DateTime(); $this->writeLn(sprintf(" Start at %s", $start->format('Y-m-d H:i:s'))); $this->initGeneratorOptions(); if ($this->canExecute() === true) { $this->initGenerator()->getGenerator()->generatePackage(); } elseif ($this->canExecute() === false) { $this->writeLn(" Generation not launched, use \"--force\" option to force generation"); $this->writeLn(sprintf(" Generator's option file used: %s", $this->resolveGeneratorOptionsConfigPath())); $this->writeLn(" Used generator's options:"); $this->writeLn(" " . implode(PHP_EOL . ' ', $this->formatArrayForConsole($this->generatorOptions->toArray()))); } $end = new \DateTime(); $this->writeLn(sprintf(" End at %s, duration: %s", $end->format('Y-m-d H:i:s'), $start->diff($end)->format('%H:%I:%S'))); }