protected function getProject()
 {
     try {
         $directory = $this->getApplication()->getWorkingDir();
         $project = Project::fromDirectory($directory);
     } catch (\Exception $e) {
         throw new \DomainException('Missing or unreadable manifest file in working directory');
     }
     return $project;
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $directory = $this->getApplication()->getWorkingDir();
     if (Project::exists($directory)) {
         throw new \DomainException(sprintf('Directory does already contain a manifest.', $directory));
     }
     $name = $input->getOption('name');
     $project = Project::create($directory, $name);
     $project->flush();
     $output->writeln(sprintf('New %s initialized.', $name ? 'project "' . $name . '"' : 'project'));
 }
Esempio n. 3
0
 protected function getDetails(Project $project)
 {
     return array('Name' => $project->getName());
 }