Declare configuration options for the extension.

@param ArrayNodeDefinition $builder
353945
public function configure(ArrayNodeDefinition $builder)
    {
        $builder
            ->children()
                // Common settings.
                ->enumNode('default_driver')
                    // "wpapi" is for backwards compatibility; means "wpphp".
                    ->values(['wpcli', 'wpapi', 'wpphp', 'blackbox'])
                    ->defaultValue('wpcli')
                ->end()
                ->scalarNode('path')
                    ->defaultValue('')
                ->end()

                // WordPress' "siteurl" option.
                ->scalarNode('site_url')->defaultValue('%mink.base_url%')->end()

                // Account roles -> username/password.
                ->arrayNode('users')
                    ->prototype('array')
                        ->children()
                            ->variableNode('roles')
                                ->defaultValue(['administrator'])
                            ->end()
                            ->scalarNode('username')
                                ->defaultValue('admin')
                            ->end()
                            ->scalarNode('password')
                                ->defaultValue('admin')
                            ->end()
                        ->end()
                    ->end()
                ->end()

                // WP-CLI driver.
                ->arrayNode('wpcli')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->scalarNode('alias')->end()
                        ->scalarNode('binary')
                            ->defaultValue('wp')
                        ->end()
                    ->end()
                ->end()

                // WordPress PHP driver.
                ->arrayNode('wpphp')
                    ->addDefaultsIfNotSet()
                    ->children()
                    ->end()
                ->end()

                // Blackbox driver.
                ->arrayNode('blackbox')
                    ->addDefaultsIfNotSet()
                    ->children()
                    ->end()
                ->end()

                // Database management.
                ->arrayNode('database')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->booleanNode('restore_after_test')
                            ->defaultFalse()
                        ->end()
                        ->scalarNode('backup_path')
                        ->end()
                    ->end()
                ->end()

                // Permalink patterns.
                ->arrayNode('permalinks')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->scalarNode('author_archive')
                            ->defaultValue('author/%s/')
                        ->end()
                    ->end()
                ->end()

                // Internal use only. Don't use it. Or else.
                ->arrayNode('internal')
                    ->addDefaultsIfNotSet()
                ->end()
            ->end()
        ->end();
    }
1023063
public function getConfig(ArrayNodeDefinition $builder)
    {
        $boolFilter = function ($v) {
            $filtered = filter_var($v, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
            return (null === $filtered) ? $v : $filtered;
        };

        $builder->
            children()->
                scalarNode('framework_script')->
                    isRequired()->
                end()->
                scalarNode('config_script')->
                    isRequired()->
                end()->
                booleanNode('mink_driver')->
                    beforeNormalization()->
                        ifString()->then($boolFilter)->
                    end()->
                    defaultFalse()->
                end()->
            end()
        ;
    }
297666
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        if ($options['plugin'] !== $this->plugin) {
            return;
        }

        $this->buildPluginForm($builder, $options);
    }
1295794
public function configure(ArrayNodeDefinition $builder) {
    $children = $builder->children();
    $children->scalarNode('phantom_server')->isRequired()->end();
    $children->scalarNode('template_cache')->defaultNull()->end();
  }
427479
private function remapBuilderColumns(Builder $builder): void {
    if($builder->aggregate === null) {
      if($builder->columns === ['*']) {
        $builder->columns = array_keys($this->to_db);
      }

      if(is_string($builder->columns)) {
        $builder->columns = [$builder->columns];
      }

      $this->remapColumns($builder->columns);
    } else {
      if($builder->aggregate['columns'] == ['*']) {
        return;
      }

      $this->remapColumns($builder->aggregate['columns'], false);
    }
  }
124912
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $this->addWalletType($builder, $options[SubFormInterface::OPTIONS_FIELD_NAME][static::OPTION_WALLET_CHOICES]);
    }
104648
public function addBuilder(BuilderInterface $builder)
    {
        $builder->setGenerator($this);
        $builder->setTemplateDirs($this->templateDirectories);
        $builder->setMustOverwriteIfExists($this->mustOverwriteIfExists);
        $builder->setVariables(array_merge($this->variables, $builder->getVariables()));

        $this->builders[] = $builder;

        return $builder;
    }
1365318
protected function addUndoEnd(Builder $builder): void
    {
        $builder->macro('undoEnd', function (Builder $builder) {
            $builder->withEnded();

            return $builder->update(['ended_at' => null]);
        });
    }
708023
protected function configure()
    {
        $this->value('builder', $this->builder);
        $this->value('frameworkBuilder', $this->builder->frameworkBuilder());
        $this->value('components', $this->builder->components());
    }
523621
protected function addActivate(Builder $builder): void
    {
        $builder->macro('activate', function (Builder $builder) {
            $builder->withNotActivated();

            return $builder->update(['is_active' => 1]);
        });
    }
1008868
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $this->addCardType($builder, $options)
            ->addNameOnCard($builder)
            ->addHiddenInputs($builder);
    }
1195499
@SuppressWarnings({ "unchecked", "rawtypes" })
    private void initializeConfigurationOptionComponents(UIBuilder builder)
    {
        for (final ConfigurationOption option : WindupConfiguration.getWindupConfigurationOptions())
        {
            InputComponent<?, ?> inputComponent = null;
            switch (option.getUIType())
            {
            case SINGLE:
            {
                UIInput<?> inputSingle = componentFactory.createInput(option.getName(), option.getType());
                inputSingle.setDefaultValue(new DefaultValueAdapter(option));
                inputComponent = inputSingle;
                break;
            }
            case MANY:
            {
                // forge can't handle "Path", so use File
                Class<?> optionType = option.getType() == Path.class ? File.class : option.getType();

                UIInputMany<?> inputMany = componentFactory.createInputMany(option.getName(), optionType);
                inputMany.setDefaultValue(new DefaultValueAdapter(option, Iterable.class));
                inputComponent = inputMany;
                break;
            }
            case SELECT_MANY:
            {
                UISelectMany<?> selectMany = componentFactory.createSelectMany(option.getName(), option.getType());
                selectMany.setValueChoices((Iterable) option.getAvailableValues());
                selectMany.setDefaultValue(new DefaultValueAdapter(option, Iterable.class));
                inputComponent = selectMany;
                break;
            }
            case SELECT_ONE:
            {
                UISelectOne<?> selectOne = componentFactory.createSelectOne(option.getName(), option.getType());
                selectOne.setValueChoices((Iterable) option.getAvailableValues());
                selectOne.setDefaultValue(new DefaultValueAdapter(option));
                inputComponent = selectOne;
                break;
            }
            case DIRECTORY:
            {
                UIInput<DirectoryResource> directoryInput = componentFactory.createInput(option.getName(),
                            DirectoryResource.class);
                directoryInput.setDefaultValue(new DefaultValueAdapter(option, DirectoryResource.class));
                inputComponent = directoryInput;
                break;
            }
            case FILE:
            {
                UIInput<?> fileInput = componentFactory.createInput(option.getName(), FileResource.class);
                fileInput.setDefaultValue(new DefaultValueAdapter(option, FileResource.class));
                inputComponent = fileInput;
                break;
            }
            case FILE_OR_DIRECTORY:
            {
                UIInput<?> fileOrDirInput = componentFactory.createInput(option.getName(), FileResource.class);
                fileOrDirInput.setDefaultValue(new DefaultValueAdapter(option, FileResource.class));
                inputComponent = fileOrDirInput;
                break;
            }
            }
            if (inputComponent == null)
            {
                throw new IllegalArgumentException("Could not build input component for: " + option);
            }
            inputComponent.setLabel(option.getLabel());
            inputComponent.setRequired(option.isRequired());
            inputComponent.setDescription(option.getDescription());
            builder.add(inputComponent);
            inputOptions.put(option, inputComponent);
        }
    }
353933
protected function instantiationOptions(SchemaBuilder $builder)
    {
        if ($this->getInstantiator() != DocumentInstantiator::class) {
            //Unable to define options for non default inheritance based instantiator
            return null;
        }

        //Let's define a way how to separate one model from another based on given fields
        $helper = new InheritanceHelper($this, $builder->getSchemas());

        return $helper->makeDefinition();
    }
1238672
public function reconfigure(AbstractConfigurationBuilder $configurationBuilder)
    {
        if (null !== $this->placeholderResolverFactory) {
            $configurationBuilder->setPlaceholderResolverFactory($this->placeholderResolverFactory);
        }

        $configurationBuilder->setConfigurationFactory($this->configurationFactory());
    }
1037951
public function appendConfiguration(ArrayNodeDefinition $rootNode)
    {
        $rootNode
            ->children()
                ->arrayNode('qa')
                    ->children()
                        ->arrayNode('phpcs')
                        ->children()
                        ->arrayNode('dir')
                        ->prototype('scalar')->end()
                        ->performNoDeepMerging()
                        ->end()
                        ->scalarNode('standard')->end()
                        ->scalarNode('options')->end()
                        ->end()
                        ->end()
                        ->arrayNode('jshint')
                        ->children()
                        ->arrayNode('files')
                        ->beforeNormalization()
                        ->ifString()->then(
                        function($v) {
                            return array_filter(array($v));
                        }
                    )
                        ->end()
                        ->prototype('scalar')->end()
                        ->performNoDeepMerging()
                        ->end()
                        ->scalarNode('run')->end()
                        ->end()
                    ->end()
                ->end()
        ->end();
    }
1164868
public function configure(ArrayNodeDefinition $builder)
  {
    $builder
      ->addDefaultsIfNotSet()
      ->children()
        ->arrayNode('templates')
          ->children()
            ->scalarNode("dir")->defaultNull()->end()
            ->scalarNode("file")->defaultValue("default.twig")->end()
          ->end()
        ->end()
        ->arrayNode('output')
          ->children()
            ->scalarNode("dir")->defaultNull()->end()
            ->scalarNode("file")->isRequired()->end()
          ->end()
        ->end()
        ->end()
    ->end();
  }
855823
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $fields = AppSettings::settings();
        foreach ($fields as $key => $value) {
            $builder->add($key, TextType::class, [
                'value' => $value,
                'required' => true,
                'constraints' => [ new Symfony\Component\Validator\Constraints\NotBlank()]
            ]);
        }
    }