FooConfig example

class ArrayExtraKeysConfig implements \Symfony\Component\Config\Builder\ConfigBuilderInterface
{
    private $foo;
    private $bar;
    private $baz;
    private $_usedProperties = [];

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

        return $this->foo;
    }

    public function bar(array $value = []): \Symfony\Config\ArrayExtraKeys\BarConfig
    {
        $this->_usedProperties['bar'] = true;

        
Home | Imprint | This part of the site doesn't use cookies.