<?php

namespace Symfony\Config;

require_once __DIR__.\DIRECTORY_SEPARATOR.'ElaoEnum'.\DIRECTORY_SEPARATOR.'DoctrineConfig.php';
require_once __DIR__.\DIRECTORY_SEPARATOR.'ElaoEnum'.\DIRECTORY_SEPARATOR.'DoctrineMongodbConfig.php';

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

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

    /**
     * @default {"enum_sql_declaration":false,"types":[]}
     * @deprecated since Symfony 7.4
     */
    public function doctrine(array $value = []): \Symfony\Config\ElaoEnum\DoctrineConfig
    {
        $this->_hasDeprecatedCalls = true;
        if (null === $this->doctrine) {
            $this->_usedProperties['doctrine'] = true;
            $this->doctrine = new \Symfony\Config\ElaoEnum\DoctrineConfig($value);
        } elseif (0 < \func_num_args()) {
            throw new InvalidConfigurationException('The node created by "doctrine()" has already been initialized. You cannot pass values the second time you call doctrine().');
        }

        return $this->doctrine;
    }

    /**
     * @default {"types":[]}
     * @deprecated since Symfony 7.4
     */
    public function doctrineMongodb(array $value = []): \Symfony\Config\ElaoEnum\DoctrineMongodbConfig
    {
        $this->_hasDeprecatedCalls = true;
        if (null === $this->doctrineMongodb) {
            $this->_usedProperties['doctrineMongodb'] = true;
            $this->doctrineMongodb = new \Symfony\Config\ElaoEnum\DoctrineMongodbConfig($value);
        } elseif (0 < \func_num_args()) {
            throw new InvalidConfigurationException('The node created by "doctrineMongodb()" has already been initialized. You cannot pass values the second time you call doctrineMongodb().');
        }

        return $this->doctrineMongodb;
    }

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

    public function __construct(array $config = [])
    {
        if (array_key_exists('doctrine', $config)) {
            $this->_usedProperties['doctrine'] = true;
            $this->doctrine = new \Symfony\Config\ElaoEnum\DoctrineConfig($config['doctrine']);
            unset($config['doctrine']);
        }

        if (array_key_exists('doctrine_mongodb', $config)) {
            $this->_usedProperties['doctrineMongodb'] = true;
            $this->doctrineMongodb = new \Symfony\Config\ElaoEnum\DoctrineMongodbConfig($config['doctrine_mongodb']);
            unset($config['doctrine_mongodb']);
        }

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

    public function toArray(): array
    {
        $output = [];
        if (isset($this->_usedProperties['doctrine'])) {
            $output['doctrine'] = $this->doctrine->toArray();
        }
        if (isset($this->_usedProperties['doctrineMongodb'])) {
            $output['doctrine_mongodb'] = $this->doctrineMongodb->toArray();
        }
        if ($this->_hasDeprecatedCalls) {
            trigger_deprecation('symfony/config', '7.4', 'Calling any fluent method on "%s" is deprecated; pass the configuration to the constructor instead.', $this::class);
        }

        return $output;
    }

}
