<?php

namespace Symfony\Config\CoopTilleulsForgotPassword;

require_once __DIR__.\DIRECTORY_SEPARATOR.'ProvidersConfig'.\DIRECTORY_SEPARATOR.'PasswordTokenConfig.php';
require_once __DIR__.\DIRECTORY_SEPARATOR.'ProvidersConfig'.\DIRECTORY_SEPARATOR.'UserConfig.php';

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 ProvidersConfig 
{
    private $manager;
    private $default;
    private $passwordToken;
    private $user;
    private $_usedProperties = [];

    /**
     * Persistence manager service to handle the token storage.
     * @default 'coop_tilleuls_forgot_password.manager.doctrine'
     * @param ParamConfigurator|mixed $value
     * @return $this
     */
    public function manager($value): static
    {
        $this->_usedProperties['manager'] = true;
        $this->manager = $value;

        return $this;
    }

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

        return $this;
    }

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

        return $this->passwordToken;
    }

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

        return $this->user;
    }

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

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

        if (array_key_exists('password_token', $config)) {
            $this->_usedProperties['passwordToken'] = true;
            $this->passwordToken = new \Symfony\Config\CoopTilleulsForgotPassword\ProvidersConfig\PasswordTokenConfig($config['password_token']);
            unset($config['password_token']);
        }

        if (array_key_exists('user', $config)) {
            $this->_usedProperties['user'] = true;
            $this->user = new \Symfony\Config\CoopTilleulsForgotPassword\ProvidersConfig\UserConfig($config['user']);
            unset($config['user']);
        }

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

        return $output;
    }

}
