PhpBench\Registry\ConfigurableRegistry::resolveConfig PHP Method

resolveConfig() private method

Recursively merge configs (having the "extends" key) which extend another report.
private resolveConfig ( $name ) : array
return array
    private function resolveConfig($name)
    {
        $config = $this->configs[$name];
        if (isset($config['extends'])) {
            $extended = $this->getConfig($config['extends']);
            if (isset($config[$this->serviceType]) && $extended[$this->serviceType] != $config[$this->serviceType]) {
                throw new \InvalidArgumentException(sprintf('%s configuration for service "%s" cannot extend configuration for different service "%s"', $this->serviceType, $config[$this->serviceType], $extended[$this->serviceType]));
            }
            unset($config['extends']);
            $config = array_merge($extended->getArrayCopy(), $config);
        }
        if (!isset($config[$this->serviceType])) {
            throw new \InvalidArgumentException(sprintf('%s configuration must EITHER indicate its target %s service with the "%s" key or extend an existing configuration with the "extends" key.', $this->serviceType, $this->serviceType, $this->serviceType));
        }
        $service = $this->getService($config[$this->serviceType]);
        $options = new OptionsResolver();
        $options->setRequired([$this->serviceType]);
        $service->configure($options);
        $config = $options->resolve($config);
        $this->resolvedConfigs[$name] = new Config($name, $config);
    }