src/DependencyInjection/Configuration.php
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('phpmob_settings');

        $rootNode
            ->children()
                ->arrayNode('cache')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->scalarNode('service')->defaultNull()->end()
                        ->integerNode('lifetime')->defaultValue(86400)->end()
                    ->end()
                ->end()
                ->arrayNode('schemas')
                    ->useAttributeAsKey('name')
                    // section
                    ->prototype('array')
                        ->children()
                            ->scalarNode('enabled')->defaultTrue()->end()
                            ->scalarNode('owner_aware')->defaultFalse()->end()
                            ->scalarNode('label')->isRequired()->end()
                            ->scalarNode('description')->defaultNull()->end()
                            ->arrayNode('settings')
                                // setting key
                                ->requiresAtLeastOneElement()
                                ->useAttributeAsKey('name')
                                ->prototype('array')
                                    ->isRequired()
                                    ->addDefaultsIfNotSet()
                                    ->children()
                                        ->scalarNode('enabled')->defaultTrue()->end()
                                        ->scalarNode('type')->defaultValue('default')->end()
                                        ->variableNode('value')->defaultNull()->end()
                                        ->scalarNode('label')->isRequired()->end()
                                        ->scalarNode('description')->defaultNull()->end()
                                        ->arrayNode('blueprint')
                                            ->addDefaultsIfNotSet()
                                            ->children()
                                                ->scalarNode('type')->defaultValue(TextType::class)->end()
                                                ->variableNode('options')
                                                    ->info('The options given to form builder.')
                                                    ->defaultValue([])
                                                    ->validate()
                                                        ->always(function ($v) {
                                                            if (!is_array($v)) {
                                                                throw new InvalidTypeException();
                                                            }

                                                            return $v;
                                                        })
                                                    ->end()
                                                ->end()
                                                ->arrayNode('constraints')
                                                    ->info('Use Symfony\Component\Validator\Constraints')
                                                    ->useAttributeAsKey('name')
                                                    ->prototype('variable')
                                                        ->defaultValue([])
                                                        ->validate()
                                                            ->always(function ($v) {
                                                                if (!is_array($v)) {
                                                                    return [];
                                                                }

                                                                return $v;
                                                            })
                                                        ->end()
                                                    ->end()
                                                ->end()
                                            ->end()
                                        ->end()
                                    ->end()
                                ->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
            ->end();

        return $treeBuilder;
    }
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('phpmob_settings');

        $rootNode
            ->children()
                ->arrayNode('cache')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->scalarNode('service')->defaultNull()->end()
                        ->integerNode('lifetime')->defaultValue(86400)->end()
                    ->end()
                ->end()
                ->arrayNode('schemas')
                    ->useAttributeAsKey('name')
                    // section
                    ->prototype('array')
                        ->children()
                            ->scalarNode('enabled')->defaultTrue()->end()
                            ->scalarNode('owner_aware')->defaultFalse()->end()
                            ->scalarNode('label')->isRequired()->end()
                            ->scalarNode('description')->defaultNull()->end()
                            ->arrayNode('settings')
                                // setting key
                                ->requiresAtLeastOneElement()
                                ->useAttributeAsKey('name')
                                ->prototype('array')
                                    ->isRequired()
                                    ->addDefaultsIfNotSet()
                                    ->children()
                                        ->scalarNode('enabled')->defaultTrue()->end()
                                        ->scalarNode('type')->defaultValue('default')->end()
                                        ->variableNode('value')->defaultNull()->end()
                                        ->scalarNode('label')->isRequired()->end()
                                        ->scalarNode('description')->defaultNull()->end()
                                        ->arrayNode('blueprint')
                                            ->addDefaultsIfNotSet()
                                            ->children()
                                                ->scalarNode('type')->defaultValue(TextType::class)->end()
                                                ->variableNode('options')
                                                    ->info('The options given to form builder.')
                                                    ->defaultValue([])
                                                    ->validate()
                                                        ->always(function ($v) {
                                                            if (!is_array($v)) {
                                                                throw new InvalidTypeException();
                                                            }

                                                            return $v;
                                                        })
                                                    ->end()
                                                ->end()
                                                ->arrayNode('constraints')
                                                    ->info('Use Symfony\Component\Validator\Constraints')
                                                    ->useAttributeAsKey('name')
                                                    ->prototype('variable')
                                                        ->defaultValue([])
                                                        ->validate()
                                                            ->always(function ($v) {
                                                                if (!is_array($v)) {
                                                                    return [];
                                                                }

                                                                return $v;
                                                            })
                                                        ->end()
                                                    ->end()
                                                ->end()
                                            ->end()
                                        ->end()
                                    ->end()
                                ->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
            ->end();

        return $treeBuilder;
    }
{@inheritdoc}