Ejemplo n.º 1
0
 /**
  * @param Project $project
  */
 public function addProject(Project $project)
 {
     $this->projects[$project->getName()] = $project;
 }
Ejemplo n.º 2
0
 private function showScripts(OutputInterface $output, Project $project, Collection $scripts)
 {
     if ($scripts->count() == 0) {
         $output->writeln('<error>No scripts for this project.</error>');
         return 0;
     }
     $output->writeln("<comment>Scripts available for " . $project->getName() . "</comment>");
     $table = new Table($output);
     $table->setHeaders(['Script Name', 'Description'])->setRows(collect($scripts)->transform(function (Script $script) use($output) {
         return ["<info>{$script->name}</info>", ucwords($script->description)];
     })->toArray());
     $table->render();
     $output->writeln(sprintf("<comment>Example use: mersey %s %s <script name></comment>", $this->server->getName(), $project->getName()));
     return 0;
 }