<?php

namespace Symfony\Config\SuluForm;

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 DynamicListBuilderConfig 
{
    private $default;
    private $delimiter;
    private $_usedProperties = [];

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

        return $this;
    }

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

        return $this;
    }

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

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

        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['default'])) {
            $output['default'] = $this->default;
        }
        if (isset($this->_usedProperties['delimiter'])) {
            $output['delimiter'] = $this->delimiter;
        }

        return $output;
    }

}
