PhpSpec\Console\Application::loadConfigurationFile PHP Méthode

loadConfigurationFile() protected méthode

protected loadConfigurationFile ( Symfony\Component\Console\Input\InputInterface $input, IndexedServiceContainer $container )
$input Symfony\Component\Console\Input\InputInterface
$container PhpSpec\ServiceContainer\IndexedServiceContainer
    protected function loadConfigurationFile(InputInterface $input, IndexedServiceContainer $container)
    {
        $config = $this->parseConfigurationFile($input);
        foreach ($config as $key => $val) {
            if ('extensions' === $key && is_array($val)) {
                foreach ($val as $class => $extensionConfig) {
                    $this->loadExtension($container, $class, $extensionConfig ?: []);
                }
            } elseif ('matchers' === $key && is_array($val)) {
                $this->registerCustomMatchers($container, $val);
            } else {
                $container->setParam($key, $val);
            }
        }
    }

Usage Example

 protected function loadConfigurationFile(InputInterface $input, ServiceContainer $container)
 {
     $container->setShared('event_dispatcher.listeners.phpguard', function ($c) {
         $ext = new PhpGuardExtension();
         if ($runner = CodeCoverageSession::getCached()) {
             $ext->setCoverageRunner($runner);
         }
         $ext->load($c);
         return $ext;
     });
     parent::loadConfigurationFile($input, $container);
 }