@param \Symfony\Component\OptionsResolver\OptionsResolver $optionsResolver

@throws \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException
@throws \Symfony\Component\OptionsResolver\Exception\AccessException
433965
private function configureOptions(OptionsResolver $optionsResolver)
    {
        $optionsResolver
            ->setDefined(['language'])
            ->setDefined(['baseLanguage'])
            ->setAllowedTypes('baseLanguage', ['null', Language::class])
            ->setAllowedTypes('language', Language::class);
    }
584615
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver
            // filter option is required
            ->setRequired('filters')
            ->setAllowedTypes('filters', 'array')

            // sources is required and should be an array
            ->setRequired('sources')
            ->setAllowedTypes('sources', 'array')

            // destination should be a string, no array is allowed for now
            ->setRequired('destinations')
            ->setAllowedTypes('destinations', 'array')

            // debug mode (allow more verbosity)
            ->setDefault('debug', false)
            ->setAllowedTypes('debug', 'boolean')
        ;
    }
980849
public function configureOptions(OptionsResolver $resolver)
    {
        $compoundNormalizer = function () {
            return false;
        };

        $multipleNormalizer = function () {
            return true;
        };

        $resolver->setDefaults([
            'multiple' => true,
        ]);

        $resolver->setNormalizer('compound', $compoundNormalizer);
        $resolver->setNormalizer('multiple', $multipleNormalizer);
    }
1200111
public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefaults([
            'data_class' => PayonePaymentTransfer::class,
        ])->setRequired(SubFormInterface::OPTIONS_FIELD_NAME);
    }
546379
public function configureOptionsResolver(OptionsResolver $resolver)
    {
        parent::configureOptionsResolver($resolver);

        $resolver->setRequired([
            self::OPTION_SERVICE,
            self::OPTION_METHOD,
        ]);

        $resolver->setAllowedTypes(self::OPTION_SERVICE, ['string']);
        $resolver->setAllowedTypes(self::OPTION_METHOD, ['string']);
    }
270566
public function configureOptionsResolver(OptionsResolver $resolver)
    {
        parent::configureOptionsResolver($resolver);
        $resolver->setDefaults([
            self::OPTION_TIMEOUT => 30,
            self::OPTION_CONNECT_TIMEOUT => 30,
            self::OPTION_TRACK => true,
        ]);

        $resolver->setRequired([
            self::OPTION_METHOD, self::OPTION_TIMEOUT, self::OPTION_CONNECT_TIMEOUT,
        ]);

        $resolver->setAllowedTypes(self::OPTION_TIMEOUT, ['numeric']);
        $resolver->setAllowedTypes(self::OPTION_CONNECT_TIMEOUT, ['numeric']);
        $resolver->setAllowedTypes(self::OPTION_METHOD, ['string']);
    }
132657
public function setDefaultOptions(OptionsResolver $resolver)
    {
        foreach ($this->middlewares as $middleware) {
            if ($middleware instanceof ConfigurableInterface) {
                $middleware->setDefaultOptions($resolver);
            }
        }
    }
707174
private function getResolver(): OptionsResolver
    {
        if (!is_null($this->resolver)) {
            return $this->resolver;
        }

        $this->resolver = $this->buildResolver();

        return $this->resolver;
    }
866625
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(
            [
                'help_label' => null,
            ]
        );
        $resolver->setRequired(
            [
                'attribute',
            ]
        );
        $resolver->setAllowedTypes('attribute', AttributeInterface::class);

        $resolver->setNormalizer(
            'help_label',
            function (Options $options, $value) {
                if (null !== $value) {
                    return $value;
                }
                /** @var AttributeInterface $attribute */
                $attribute = $options['attribute'];

                $messages = [];
                if ($attribute->getType()->isRelation()) {
                    $messages[] = '<p class="text-warning"><b>Warning:</b> This attribute is a relation, in a flat format (like CSV) only the configured column will be exported</p>';
                }
                if ($attribute->isCollection()) {
                    $messages[] = '<p class="text-warning"><b>Warning:</b> This attribute is a collection, in a flat format (like CSV) the values will be joined together using the split character</p>';
                }
                if ($attribute->isUnique()) {
                    return '<p class="text-muted">This attribute is unique</p>';
                }

                return implode("\n", $messages);
            }
        );
    }
118218
private function configureProcessProperties(OptionsResolver $resolver)
    {
        $resolver
            ->setRequired('command')
            ->setAllowedTypes('command', 'string');

        $resolver
            ->setDefined('process_name')
            ->setAllowedTypes('process_name', 'string');

        $resolver->setDefined('numprocs')
            ->setAllowedTypes('numprocs', 'int');

        $resolver->setDefined('numprocs_start')
            ->setAllowedTypes('numprocs_start', 'int');

        $resolver->setDefined('priority')
            ->setAllowedTypes('priority', 'int');
    }
74252
private function configureOptionsResolver(OptionsResolver $optionsResolver)
    {
        $optionsResolver->setDefaults([
            'group' => 'head',
            'defaults' => [],
        ]);

        $optionsResolver->setAllowedValues('group', ['head']);
        $optionsResolver->setAllowedTypes('defaults', 'array');

        return $optionsResolver;
    }
1074065
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(
            [
                'choices' => null,
                'families' => null,
            ]
        );

        $resolver->setNormalizer(
            'families',
            function (Options $options, $values) {
                if (null === $values) {
                    $values = $this->familyRegistry->getFamilies();
                }
                $families = [];
                foreach ($values as $value) {
                    if (!$value instanceof FamilyInterface) {
                        $value = $this->familyRegistry->getFamily($value);
                    }
                    if ($value->isInstantiable()) {
                        $families[$value->getCode()] = $value;
                    }
                }

                return $families;
            }
        );
        $resolver->setNormalizer(
            'choices',
            function (Options $options, $value) {
                if (null !== $value) {
                    throw new \UnexpectedValueException(
                        "'choices' options is not supported for family selector, please use 'families' option"
                    );
                }
                $choices = [];
                /** @var FamilyInterface[] $families */
                $families = $options['families'];
                $duplicates = [];
                foreach ($families as $family) {
                    if ($family->isInstantiable()) {
                        $label = ucfirst($family);
                        if (array_key_exists($label, $choices)) {
                            // Storing duplicates
                            $duplicates[] = $label;
                            $label = "{$label} ({$family->getCode()})";
                        }
                        $choices[$label] = $family->getCode();
                    }
                }

                // Recreating duplicates
                foreach ($duplicates as $duplicate) {
                    $choices["{$duplicate} ({$choices[$duplicate]})"] = $choices[$duplicate];
                    unset($choices[$duplicate]);
                }
                ksort($choices);

                return $choices;
            }
        );
    }
878000
protected function resolveOptions(OptionsResolver $resolver)
    {
        $resolver->setRequired('directories');
        $resolver->setDefault('baseDirectory', null);
        $resolver->setAllowedTypes('directories', 'array');
    }
1067943
private function getResolver()
    {
        if ($this->resolver === null) {
            $this->resolver = new OptionsResolver();
            $this->configureOptions($this->resolver);
        }

        return $this->resolver;
    }
934192
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(array(
            'border' => false,
            'sortable' => false,
            'sortable_property' => 'position',
            'prototype' => true,
            'allow_add' => true,
            'by_reference' => false,
            'allow_delete' => true
        ));

        $resolver->setNormalizer('prototype_name', function(Options $options, $value) {
            return '__' . uniqid() . '__';
        });
    }
821891
public function setDefaultOptions(OptionsResolverInterface $resolver)
    {      
        $defaultConfigs = array(
            'tpl' => 'slider.value: __value__',
            'min' => 0,
            'max' => 100,
            'orientation' => 'horizontal',
            'width' => '300px',
            'height' => '300px',
            'range' => 'min',
       );
        
        $resolver->setDefaults(array(
            'translation_domain' => 'NeutronFormBundle',
            'configs' => $defaultConfigs,
        ));
        
        $resolver->setNormalizers(array(
            'configs' => function (Options $options, $value) use ($defaultConfigs) {
                $value = array_replace_recursive($defaultConfigs, $value);
                
                if($value['orientation'] == 'horizontal'){
                    unset($value['height']);
                } else {
                    unset($value['width']);
                }
                
                if (!in_array($value['range'], array('min', 'max'), true)){
                    throw new \InvalidArgumentException(sprintf('Option range with value "%s" must be set to  "min" or "max"', $value['range']));
                }
                
                return $value;
            }
        ));
    }
1354065
protected function configureOptions(OptionsResolver $resolver): void
    {
        // We set object properties' _default_ values to null to ensure we do not create unnecessary objects.
        $resolver->setDefaults([
            static::CONFIG_USER_AGENT_PREFIX => null,
            static::CONFIG_HTTP_CLIENT_BUILDER => null,
            static::CONFIG_JOURNAL => null,
            static::CONFIG_URI_FACTORY => null,
            static::CONFIG_REQUEST_FACTORY => null,
            static::CONFIG_ERROR_FORMATTER => null,
            static::CONFIG_RETRY_PLUGIN_CONFIG => null,
        ]);
        $resolver->setAllowedTypes(static::CONFIG_USER_AGENT_PREFIX, ['null', 'string']);
        $resolver->setAllowedTypes(static::CONFIG_HTTP_CLIENT_BUILDER, ['null', '\Apigee\Edge\HttpClient\Utility\BuilderInterface']);
        $resolver->setAllowedTypes(static::CONFIG_JOURNAL, ['null', '\Apigee\Edge\HttpClient\Utility\JournalInterface']);
        $resolver->setAllowedTypes(static::CONFIG_URI_FACTORY, ['null', '\Http\Message\UriFactory']);
        $resolver->setAllowedTypes(static::CONFIG_REQUEST_FACTORY, ['null', '\Http\Message\RequestFactory']);
        $resolver->setAllowedTypes(static::CONFIG_ERROR_FORMATTER, ['null', '\Http\Message\Formatter']);
        $resolver->setAllowedTypes(static::CONFIG_RETRY_PLUGIN_CONFIG, ['null', 'array']);
    }