Example #1
0
 /**
  * @param InputInterface $input
  * @param OutputInterface $output
  */
 public function run(InputInterface $input, OutputInterface $output)
 {
     $fixtureIterator = new FixtureIterator(APP_DIR . '/src/Fixture');
     foreach ($fixtureIterator as $fixture) {
         $fixtures[] = $fixture;
     }
     usort($fixtures, function (AbstractFixture $a, AbstractFixture $b) {
         return $a->getOrder() > $b->getOrder() ? 1 : -1;
     });
     foreach ($fixtures as $fixture) {
         $output->writeln(sprintf("%d: Loading fixture %s", $fixture->getOrder(), get_class($fixture)));
         $fixture->load($output);
     }
 }
Example #2
0
 /**
  * @param OutputInterface $output
  */
 private function printJobsList(OutputInterface $output)
 {
     $sections = [];
     $maxLength = 0;
     foreach ($this->jobs as $job) {
         $maxLength = max($maxLength, strlen($job->getName()));
         $nameParams = explode(':', $job->getName());
         $sections[$nameParams[0]][] = $job;
     }
     foreach ($sections as $section => $jobs) {
         $output->writeln(sprintf('%s:', $section));
         /** @var JobInterface $job */
         foreach ($jobs as $job) {
             $spacesNumber = $maxLength - strlen($job->getName()) + 1;
             $output->writeln(sprintf("\t%s%s%s", $job->getName(), str_repeat(' ', $spacesNumber), $job->getInfo()));
         }
         $output->writeln('');
     }
 }
Example #3
0
 public function run(InputInterface $input, OutputInterface $output)
 {
     $output->writeln('Hello, World!');
 }