Add consumer configuration

@param ArrayNodeDefinition $node
352391
protected function addIndividualConsumerConfiguration(ArrayNodeDefinition $node)
    {
        $node
            ->normalizeKeys(false)
            ->children()
                ->integerNode('messages')
                    ->min(0)
                    ->defaultNull()
                ->end()
                ->integerNode('memory-limit')
                    ->defaultNull()
                ->end()
                ->booleanNode('debug')
                    ->defaultNull()
                ->end()
                ->booleanNode('without-signals')
                    ->defaultNull()
                ->end()
                ->scalarNode('command')
                    ->defaultNull()
                ->end()
                ->arrayNode('worker')
                    ->children()
                        ->integerNode('count')
                            ->min(1)
                            ->defaultNull()
                        ->end()
                        ->integerNode('startsecs')
                            ->min(0)
                            ->defaultNull()
                        ->end()
                        ->booleanNode('autorestart')
                            ->defaultNull()
                        ->end()
                        ->enumNode('stopsignal')
                            ->values(array('TERM', 'INT', 'KILL'))
                            ->defaultNull()
                        ->end()
                        ->booleanNode('stopasgroup')
                            ->defaultNull()
                        ->end()
                        ->integerNode('stopwaitsecs')
                            ->min(0)
                            ->defaultNull()
                        ->end()
                    ->end()
                ->end()
            ->end()
        ;
    }
1209240
protected function setupTree(ArrayNodeDefinition $rootNode)
    {
        $rootNode
            ->children()
                ->arrayNode('repositories')
                    ->prototype('array')
                        ->children()
                            ->scalarNode('secret')
                                ->isRequired()
                            ->end()
                            ->scalarNode('endpoint')
                                ->isRequired()
                            ->end()
                            ->booleanNode('test')
                                ->defaultFalse();
    }
1020235
public function addNode(\Ydle\HubBundle\Entity\Node $node)
    {
        $this->nodes[] = $node;

        return $this;
    }
194245
private function addFlashMessageSection(ArrayNodeDefinition $node)
    {
        $node
            ->children()
                ->scalarNode('form_type')
                    ->defaultValue('standard')
                    ->validate()
                    ->ifNotInArray($validFormTypes = ['standard', 'horizontal'])
                        ->thenInvalid(sprintf(
                            'The form_type option value must be one of %s',
                            $validFormTypesString = implode(', ', $validFormTypes)
                        ))
                    ->end()
                    ->info(sprintf('Must be one of %s', $validFormTypesString))
                ->end()
                ->arrayNode('flashmessage')
                    ->useAttributeAsKey('message')
                    ->prototype('array')
                        ->children()
                            ->scalarNode('css_class')->end()
                            ->arrayNode('types')
                                ->useAttributeAsKey('type')
                                ->prototype('array')
                                    ->children()
                                        ->scalarNode('domain')->defaultValue('SonataCoreBundle')->end()
                                    ->end()
                                ->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
            ->end()
        ;
    }
945632
private function addSerializerFormats(ArrayNodeDefinition $node)
    {
        // NEXT_MAJOR : do not execute this if jms/serializer is missing
        $node
            ->children()
                ->arrayNode('serializer')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->arrayNode('formats')
                            ->prototype('scalar')->end()
                            ->defaultValue(['json', 'xml', 'yml'])
                            ->info('Default serializer formats, will be used while getting subscribing methods.')
                        ->end()
                    ->end()
                ->end()
            ->end()
        ;
    }
1011643
private function addPageSection(ArrayNodeDefinition $node)
    {
        /** @noinspection PhpUndefinedMethodInspection */
        $node
            ->children()
                ->arrayNode('page')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->arrayNode('controllers')
                            ->defaultValue(['default' => [
                                'title'    => 'Par défaut',
                                'value'    => 'EkynaCmsBundle:Cms:default',
                                'advanced' => true,
                            ]])
                            ->useAttributeAsKey('name')
                            ->prototype('array')
                                ->children()
                                    ->scalarNode('title')->isRequired()->cannotBeEmpty()->end()
                                    ->scalarNode('value')->isRequired()->cannotBeEmpty()->end()
                                    ->booleanNode('advanced')->defaultFalse()->end()
                                ->end()
                            ->end()
                        ->end()
                        ->arrayNode('cookie_consent')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->booleanNode('enable')->defaultTrue()->end()
                                ->scalarNode('controller')->defaultValue('EkynaCmsBundle:Cms:default')->end()
                            ->end()
                        ->end()
                        ->arrayNode('wide_search')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->booleanNode('enable')->defaultTrue()->end()
                                ->scalarNode('controller')->defaultValue('EkynaCmsBundle:Cms:search')->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
            ->end();
    }
1366560
private function addPoolsSection(ArrayNodeDefinition $node)
    {
        $node
            ->children()
                ->arrayNode('pools')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->arrayNode('user')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->variableNode('templates')->defaultValue([
                                    '_form.html' => 'EkynaUserBundle:Admin/User:_form.html',
                                    'show.html'  => 'EkynaUserBundle:Admin/User:show.html',
                                ])->end()
                                ->scalarNode('entity')->defaultValue('Ekyna\Bundle\UserBundle\Entity\User')->end()
                                ->scalarNode('controller')->defaultValue('Ekyna\Bundle\UserBundle\Controller\Admin\UserController')->end()
                                ->scalarNode('repository')->defaultValue('Ekyna\Bundle\UserBundle\Entity\UserRepository')->end()
                                ->scalarNode('form')->defaultValue('Ekyna\Bundle\UserBundle\Form\Type\UserType')->end()
                                ->scalarNode('table')->defaultValue('Ekyna\Bundle\UserBundle\Table\Type\UserType')->end()
                                ->scalarNode('parent')->end()
                                ->scalarNode('event')->defaultValue('Ekyna\Bundle\UserBundle\Event\UserEvent')->end()
                            ->end()
                        ->end()
                        ->arrayNode('group')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->variableNode('templates')->defaultValue([
                                    '_form.html' => 'EkynaUserBundle:Admin/Group:_form.html',
                                    'show.html'  => 'EkynaUserBundle:Admin/Group:show.html',
                                ])->end()
                                ->scalarNode('entity')->defaultValue('Ekyna\Bundle\UserBundle\Entity\Group')->end()
                                ->scalarNode('controller')->defaultValue('Ekyna\Bundle\UserBundle\Controller\Admin\GroupController')->end()
                                ->scalarNode('repository')->defaultValue('Ekyna\Bundle\UserBundle\Entity\GroupRepository')->end()
                                ->scalarNode('form')->defaultValue('Ekyna\Bundle\UserBundle\Form\Type\GroupType')->end()
                                ->scalarNode('table')->defaultValue('Ekyna\Bundle\UserBundle\Table\Type\GroupType')->end()
                                ->scalarNode('parent')->end()
                                ->scalarNode('event')->end()
                            ->end()
                        ->end()
                        ->arrayNode('address')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->variableNode('templates')->defaultValue('EkynaUserBundle:Admin/Address')->end()
                                ->scalarNode('entity')->defaultValue('Ekyna\Bundle\UserBundle\Entity\Address')->end()
                                ->scalarNode('controller')->end()
                                ->scalarNode('repository')->defaultValue('Ekyna\Bundle\UserBundle\Entity\AddressRepository')->end()
                                ->scalarNode('form')->defaultValue('Ekyna\Bundle\UserBundle\Form\Type\AddressType')->end()
                                ->scalarNode('table')->defaultValue('Ekyna\Bundle\UserBundle\Table\Type\AddressType')->end()
                                ->scalarNode('parent')->defaultValue('ekyna_user.user')->end()
                                ->scalarNode('event')->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
            ->end()
        ;
    }
769594
public function addToArrayNode(AbstractNode $node): QueryBuilderInterface
    {
        if (!$this->node instanceof ArrayNode) {
            throw new \Exception(sprintf('You cannot call %s on node type: %s', __FUNCTION__, get_class($this->node)));
        }

        $this->node->add($node);
        $this->reassignParent($node);

        return $this;
    }
420702
private function addStepListSection(ArrayNodeDefinition $node)
    {
        $node
            ->children()
                ->arrayNode('shared_step_list')
                    ->useAttributeAsKey('shared_step_name')
                    ->prototype('array')
                        ->children()
                            ->scalarNode('parent_shared_step')
                                ->cannotBeEmpty()
                            ->end()
                            ->scalarNode('class')
                                ->cannotBeEmpty()
                            ->end()
                            ->arrayNode('parameter_list')
                                ->defaultValue(array())
                                ->useAttributeAsKey('parameter_name')
                                ->prototype('variable')
                                ->end()
                            ->end()
                            ->arrayNode('service_list')
                                ->defaultValue(array())
                                ->useAttributeAsKey('service_name')
                                ->prototype('scalar')
                                ->end()
                            ->end()
                            ->arrayNode('help')
                                ->children()
                                    ->scalarNode('short')
                                        ->cannotBeEmpty()
                                    ->end()
                                    ->scalarNode('complete')
                                        ->cannotBeEmpty()
                                    ->end()
                                    ->booleanNode('private')
                                        ->defaultValue(false)
                                        ->cannotBeEmpty()
                                    ->end()
                                ->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
            ->end();
    }
736372
private function addBlocksSection(ArrayNodeDefinition $node)
    {
        $node
            ->children()
                ->arrayNode('blocks')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->arrayNode('button')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->scalarNode('view')->defaultValue('OpiferContentBundle:Block:Content/button.html.twig')->end()
                                ->arrayNode('styles')
                                    ->prototype('scalar')->end()
                                    ->defaultValue([
                                        'btn-sm', 'btn-lg', 'btn-primary', 'btn-default', 'btn-block', 'center-block'
                                    ])
                                ->end()
                            ->end()
                        ->end()
                        ->arrayNode('carousel')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->scalarNode('view')->defaultValue('OpiferContentBundle:Block:Content/carousel.html.twig')->end()
                            ->end()
                        ->end()
                        ->arrayNode('carousel_slide')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->scalarNode('view')->defaultValue('OpiferContentBundle:Block:Content/carousel_slide.html.twig')->end()
                                ->arrayNode('styles')
                                    ->prototype('scalar')->end()
                                    ->defaultValue(['default'])
                                ->end()
                            ->end()
                        ->end()
                        ->arrayNode('collection')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->scalarNode('view')->defaultValue('OpiferContentBundle:Block:Content/collection.html.twig')->end()
                            ->end()
                        ->end()
                        ->arrayNode('column')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->scalarNode('view')->defaultValue('OpiferContentBundle:Block:Layout/layout.html.twig')->end()
                            ->end()
                        ->end()
                        ->arrayNode('container')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->scalarNode('view')->defaultValue('OpiferContentBundle:Block:Layout/layout.html.twig')->end()
                                ->arrayNode('styles')
                                    ->prototype('scalar')->end()
                                    ->normalizeKeys(false)
                                    ->useAttributeAsKey('name')
                                ->end()
                            ->end()
                        ->end()
                        ->arrayNode('section')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->scalarNode('view')->defaultValue('OpiferContentBundle:Block:Layout/section.html.twig')->end()
                                ->arrayNode('styles')
                                    ->prototype('scalar')->end()
                                    ->normalizeKeys(false)
                                    ->useAttributeAsKey('name')
                                ->end()
                            ->end()
                        ->end()
                        ->arrayNode('html')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->scalarNode('view')->defaultValue('OpiferContentBundle:Block:Content/html.html.twig')->end()
                            ->end()
                        ->end()
                        ->arrayNode('image')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->scalarNode('view')->defaultValue('OpiferContentBundle:Block:Content/image.html.twig')->end()
                                ->arrayNode('allowed_filters')
                                    ->prototype('scalar')->end()
                                    ->defaultValue([
                                        'medialibrary', 'dashboard_content'
                                    ])
                                ->end()
                            ->end()
                        ->end()
                        ->arrayNode('jumbotron')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->scalarNode('view')->defaultValue('OpiferContentBundle:Block:Content/jumbotron.html.twig')->end()
                                ->arrayNode('styles')
                                    ->prototype('scalar')->end()
                                    ->normalizeKeys(false)
                                    ->defaultValue([
                                        'jumbotron-sm' => 'Jumbotron small',
                                        'jumbotron-md' => 'Jumbotron medium',
                                        'jumbotron-lg' => 'Jumbotron large',
                                        'text-regular' => 'Text-color regular',
                                        'text-contrast' => 'Text-color contrast',
                                    ])
                                ->end()
                            ->end()
                        ->end()
                        ->arrayNode('list')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->scalarNode('view')->defaultValue('OpiferContentBundle:Block:Content/list.html.twig')->end()
                                ->arrayNode('styles')
                                    ->prototype('scalar')->end()
                                    ->normalizeKeys(false)
                                    ->useAttributeAsKey('name')
                                ->end()
                                ->arrayNode('templates')
                                    ->prototype('scalar')->end()
                                    ->normalizeKeys(false)
                                    ->useAttributeAsKey('name')
                                    ->defaultValue([
                                        'list_simple' => 'Simple list',
                                        'tiles' => 'Tiles',
                                        'tiles_text' => 'Tiles with description'
                                    ])
                                ->end()
                            ->end()
                        ->end()
                        ->arrayNode('navigation')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->scalarNode('view')->defaultValue('OpiferContentBundle:Block:Content/navigation.html.twig')->end()
                            ->end()
                        ->end()
                        ->arrayNode('pointer')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->scalarNode('view')->defaultValue('OpiferContentBundle:Block:Content/pointer.html.twig')->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
            ->end()
        ;
    }
1049687
public function setNode(?string $node): NodeAwareDefinitionInterface
    {
        if ($node && !preg_match('/\w+/', $node)) {
            throw new \InvalidArgumentException('Invalid node name');
        }

        $this->node = $node;

        return $this;
    }
317374
public function configure(ArrayNodeDefinition $builder)
    {
        $builder->children()->scalarNode('filename')->defaultValue('test_report.xml');
        $builder->children()->scalarNode('outputDir')->defaultValue('build/tests');
    }
1178831
public function createDefinitionFromNode(Node $node, string $fqn = null): Definition
    {
        $def = new Definition;
        $def->fqn = $fqn;

        // Determines whether the suggestion will show after "new"
        $def->canBeInstantiated = (
            $node instanceof Node\Statement\ClassDeclaration &&
            // check whether it is not an abstract class
            ($node->abstractOrFinalModifier === null || $node->abstractOrFinalModifier->kind !== PhpParser\TokenKind::AbstractKeyword)
        );

        // Interfaces, classes, traits, namespaces, functions, and global const elements
        $def->isMember = !(
            $node instanceof PhpParser\ClassLike ||

            ($node instanceof Node\Statement\NamespaceDefinition && $node->name !== null) ||

            $node instanceof Node\Statement\FunctionDeclaration ||

            ($node instanceof Node\ConstElement && $node->parent->parent instanceof Node\Statement\ConstDeclaration)
        );

        // Definition is affected by global namespace fallback if it is a global constant or a global function
        $def->roamed = (
            $fqn !== null
            && strpos($fqn, '\\') === false
            && (
                ($node instanceof Node\ConstElement && $node->parent->parent instanceof Node\Statement\ConstDeclaration)
                || $node instanceof Node\Statement\FunctionDeclaration
            )
        );

        // Static methods and static property declarations
        $def->isStatic = (
            ($node instanceof Node\MethodDeclaration && $node->isStatic()) ||

            (($propertyDeclaration = ParserHelpers\tryGetPropertyDeclaration($node)) !== null
            && $propertyDeclaration->isStatic())
        );

        if ($node instanceof Node\Statement\ClassDeclaration &&
            // TODO - this should be better represented in the parser API
            $node->classBaseClause !== null && $node->classBaseClause->baseClass !== null) {
            $def->extends = [(string)$node->classBaseClause->baseClass->getResolvedName()];
        } elseif (
            $node instanceof Node\Statement\InterfaceDeclaration &&
            // TODO - this should be better represented in the parser API
            $node->interfaceBaseClause !== null && $node->interfaceBaseClause->interfaceNameList !== null
        ) {
            $def->extends = [];
            foreach ($node->interfaceBaseClause->interfaceNameList->getValues() as $n) {
                $def->extends[] = (string)$n->getResolvedName();
            }
        }

        $def->symbolInformation = SymbolInformationFactory::fromNode($node, $fqn);

        if ($def->symbolInformation !== null) {
            $def->type = $this->getTypeFromNode($node);
            $def->declarationLine = $this->getDeclarationLineFromNode($node);
            $def->documentation = $this->getDocumentationFromNode($node);
        }

        if ($node instanceof FunctionLike) {
            $def->signatureInformation = $this->signatureInformationFactory->create($node);
        }

        return $def;
    }
923735
private function addBlocksSection(ArrayNodeDefinition $node)
    {
        $node
            ->children()
                ->arrayNode('blocks')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->arrayNode('subscribe')
                            ->addDefaultsIfNotSet()
                            ->children()
                                ->scalarNode('view')->defaultValue('OpiferMailingListBundle:Block:subscribe.html.twig')->end()
                                ->arrayNode('templates')
                                    ->prototype('scalar')->end()
                                    ->normalizeKeys(false)
                                    ->useAttributeAsKey('name')
                                    ->defaultValue([])
                                ->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
            ->end()
        ;
    }
545380
public function addConfigurationSection(ArrayNodeDefinition $node)
    {
        $node
            ->addDefaultsIfNotSet()
            ->children()
                ->scalarNode('website_name')->cannotBeEmpty()->defaultValue('Qcm Demo')->end()
                ->arrayNode('configuration')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->scalarNode('max_questions')->cannotBeEmpty()->defaultValue(40)->end()
                        ->arrayNode('question_level')
                            ->useAttributeAsKey('level')
                            ->prototype('scalar')->end()
                        ->end()
                        ->scalarNode('answers_max')->cannotBeEmpty()->defaultValue(5)->end()
                        ->scalarNode('timeout')->cannotBeEmpty()->defaultValue(2400)->end()
                        ->scalarNode('time_per_question')->cannotBeEmpty()->defaultValue(60)->end()
                    ->end()
                ->end()
            ->end();
    }
405365
protected function addPaths(ArrayNodeDefinition $node)
    {
        $node
            ->fixXmlConfig('path')
            ->children()
                ->arrayNode('paths')
                ->addDefaultsIfNotSet()
                    ->children()
                        ->scalarNode('workspace_directory')->defaultValue('%kernel.root_dir%/supervisor/%kernel.environment%/')->end()
                        ->scalarNode('configuration_file')->defaultValue('%kernel.root_dir%/supervisor/%kernel.environment%/supervisord.conf')->end()
                        ->scalarNode('pid_file')->defaultValue('%kernel.root_dir%/supervisor/%kernel.environment%/supervisor.pid')->end()
                        ->scalarNode('sock_file')->defaultValue('%kernel.root_dir%/supervisor/%kernel.environment%/supervisor.sock')->end()
                        ->scalarNode('log_file')->defaultValue('%kernel.root_dir%/supervisor/%kernel.environment%/supervisord.log')->end()
                        ->scalarNode('worker_configuration_directory')->defaultValue('%kernel.root_dir%/supervisor/%kernel.environment%/worker/')->end()
                        ->scalarNode('worker_output_log_file')->defaultValue('%kernel.root_dir%/supervisor/%kernel.environment%/logs/stdout.log')->end()
                        ->scalarNode('worker_error_log_file')->defaultValue('%kernel.root_dir%/supervisor/%kernel.environment%/logs/stderr.log')->end()
                        ->scalarNode('php_executable')->defaultValue('php')->end()
                    ->end()
                ->end()
            ->end()
        ;
    }
381313
public void addNode(final INodeEntry node) {
        //convert to entity
        final ResourceXMLParser.Entity entity = createEntity(node);
        addEntity(entity);
    }