private function findSuite() { $suites = $this->suiteRepository->getSuites(); if (count($suites) > 0 && null === $this->suite) { return $suites[0]; } foreach ($suites as $suite) { if ($this->suite === $suite->getName()) { return $suite; } } throw new \RuntimeException(sprintf('Suite %s not found', $this->suite)); }
/** * {@inheritdoc} */ public function execute(InputInterface $input, OutputInterface $output) { $exerciseSuiteName = $input->getOption('suite'); if (null !== $exerciseSuiteName && !isset($this->suiteConfigurations[$exerciseSuiteName])) { throw new SuiteNotFoundException(sprintf('`%s` suite is not found or has not been properly registered.', $exerciseSuiteName), $exerciseSuiteName); } foreach ($this->suiteConfigurations as $name => $config) { if (null !== $exerciseSuiteName && $exerciseSuiteName !== $name) { continue; } $this->registry->registerSuiteConfiguration($name, $config['type'], $config['settings']); } }