<?php

namespace Symfony\Config;

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

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

    /**
     * @default 'doctrine_orm'
     * @param ParamConfigurator|'doctrine_orm' $value
     * @return $this
     */
    public function dbDriver($value): self
    {
        $this->_usedProperties['dbDriver'] = true;
        $this->dbDriver = $value;

        return $this;
    }

    /**
     * @default 'Craue\\ConfigBundle\\Entity\\Setting'
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function entityName($value): self
    {
        $this->_usedProperties['entityName'] = true;
        $this->entityName = $value;

        return $this;
    }

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

    public function __construct(array $value = [])
    {
        if (array_key_exists('db_driver', $value)) {
            $this->_usedProperties['dbDriver'] = true;
            $this->dbDriver = $value['db_driver'];
            unset($value['db_driver']);
        }

        if (array_key_exists('entity_name', $value)) {
            $this->_usedProperties['entityName'] = true;
            $this->entityName = $value['entity_name'];
            unset($value['entity_name']);
        }

        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['dbDriver'])) {
            $output['db_driver'] = $this->dbDriver;
        }
        if (isset($this->_usedProperties['entityName'])) {
            $output['entity_name'] = $this->entityName;
        }

        return $output;
    }

}
