<?php

namespace Symfony\Config;

require_once __DIR__.\DIRECTORY_SEPARATOR.'OroTranslation'.\DIRECTORY_SEPARATOR.'JsTranslationConfig.php';

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

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

    public function jsTranslation(array $value = []): \Symfony\Config\OroTranslation\JsTranslationConfig
    {
        if (null === $this->jsTranslation) {
            $this->_usedProperties['jsTranslation'] = true;
            $this->jsTranslation = new \Symfony\Config\OroTranslation\JsTranslationConfig($value);
        } elseif (0 < \func_num_args()) {
            throw new InvalidConfigurationException('The node created by "jsTranslation()" has already been initialized. You cannot pass values the second time you call jsTranslation().');
        }

        return $this->jsTranslation;
    }

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

    public function __construct(array $value = [])
    {
        if (array_key_exists('js_translation', $value)) {
            $this->_usedProperties['jsTranslation'] = true;
            $this->jsTranslation = new \Symfony\Config\OroTranslation\JsTranslationConfig($value['js_translation']);
            unset($value['js_translation']);
        }

        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['jsTranslation'])) {
            $output['js_translation'] = $this->jsTranslation->toArray();
        }

        return $output;
    }

}
