private function parseConfiguration($name, $options) { $result = new Config(); $result->setName($name); $result->setDriver($options['driver']); $result->setSource($options['source']); $result->setRepository($options['repository']); foreach ($options['builders'] as $builder) { $builder = $this->parseBuilder($builder); $result->addBuilder($builder); } return $result; }
private function configureGenerator(Config $configuration, Payload $payload) { $inputDir = $this->detectConfigFile($configuration->getSource()); $this->generator->setInputDirectory($inputDir); foreach ($configuration->getBuilders() as $builder) { switch ($builder['type']) { case 'html': $builder = $this->configureHtmlBuilder($configuration, $payload, $builder); break; default: throw new \RuntimeException('Invalid builder type: ' . $builder['type']); } $this->generator->addBuilder($builder); } return $this->generator; }