<?php

namespace Symfony\Config;

require_once __DIR__.\DIRECTORY_SEPARATOR.'AkeneoFeatureFlag'.\DIRECTORY_SEPARATOR.'FeatureFlagsConfig.php';

use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;

/**
 * This class is automatically generated to help in creating a config.
 */
class AkeneoFeatureFlagConfig implements \Symfony\Component\Config\Builder\ConfigBuilderInterface
{
    private $featureFlags;
    private $_usedProperties = [];

    public function featureFlags(array $value = []): \Symfony\Config\AkeneoFeatureFlag\FeatureFlagsConfig
    {
        $this->_usedProperties['featureFlags'] = true;

        return $this->featureFlags[] = new \Symfony\Config\AkeneoFeatureFlag\FeatureFlagsConfig($value);
    }

    public function getExtensionAlias(): string
    {
        return 'akeneo_feature_flag';
    }

    public function __construct(array $value = [])
    {
        if (array_key_exists('feature_flags', $value)) {
            $this->_usedProperties['featureFlags'] = true;
            $this->featureFlags = array_map(function ($v) { return new \Symfony\Config\AkeneoFeatureFlag\FeatureFlagsConfig($v); }, $value['feature_flags']);
            unset($value['feature_flags']);
        }

        if ([] !== $value) {
            throw new InvalidConfigurationException(sprintf('The following keys are not supported by "%s": ', __CLASS__).implode(', ', array_keys($value)));
        }
    }

    public function toArray(): array
    {
        $output = [];
        if (isset($this->_usedProperties['featureFlags'])) {
            $output['feature_flags'] = array_map(function ($v) { return $v->toArray(); }, $this->featureFlags);
        }

        return $output;
    }

}
