Add the [pre_addon|post_addon] option

@param OptionsResolver $resolver
508482
public function configureOptions(OptionsResolver $resolver) {
        $resolver->setDefined('ad_component_addon') # pre|post|both
            ->setDefined('ad_component_addon_type') # text|button|icon
            ->setDefined('ad_component_addon_content_type') # text|icon
            ->setDefined('ad_component_addon_content')
            ->setDefined('ad_component_addon_attr');
        $resolver->setDefaults([
           'ad_component_addon_type' => ['pre' => 'text', 'post' => 'text'],
            'ad_component_addon_content_type' => ['pre' => 'text', 'post' => 'text']
        ]);
    }
109277
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(
            [
                'route' => null,
                'route_parameters' => [],
                'uri' => null,
                'attr' => [
                    'class' => 'btn btn-default btn-light',
                ],
            ]
        );
        $resolver->setAllowedTypes('route_parameters', 'array');
        $resolver->setNormalizer(
            'route',
            function (Options $options, $value) {
                if (!($value xor $options['uri'])) {
                    throw new \UnexpectedValueException("You must specify either a 'route' or an 'uri' option");
                }

                return $value;
            }
        );
    }
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;
            }
        ));
    }
184417
private function configureProcessProperties(OptionsResolver $resolver)
    {
        $resolver
            ->setRequired('command')
            ->setAllowedTypes('command', 'string');

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

        $resolver->setDefined('numprocs');
        $this->configureIntegerProperty('numprocs', $resolver);

        $resolver->setDefined('numprocs_start');
        $this->configureIntegerProperty('numprocs_start', $resolver);

        $resolver->setDefined('priority');
        $this->configureIntegerProperty('priority', $resolver);
    }
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;
            }
        );
    }
14789
public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $defaultConfigs = array();
        
        $resolver->setDefaults(array(
            'translation_domain' => 'ThraceFormBundle',
            'by_reference' => false,
            'configs' => $defaultConfigs,
        ));
        
        $resolver->setNormalizers(array(
            'configs' => function (Options $options, $value) use ($defaultConfigs){
                $configs = array_replace_recursive($defaultConfigs, $value);
                return $configs;
            }
        ));
          
        $resolver->setRequired(array('reference_class', 'inversed_class', 'inversed_property'));
    }
788575
private function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setRequired([
            'recipient',
            'subject',
            'template',
        ]);

        $resolver->setDefault('from', $this->configuration[0]);
        $resolver->setDefault('bcc', [$this->configuration[1]]);
        $resolver->setDefault('parameters', []);
        $resolver->setDefault('attachments', []);

        $resolver->setAllowedTypes('recipient', ['string', 'array']);
        $resolver->setAllowedTypes('bcc', ['string', 'array']);
//        $resolver->setAllowedTypes('reply_to', ['string', 'array']);
        $resolver->setAllowedTypes('subject', ['string']);
        $resolver->setAllowedTypes('template', ['string']);
        $resolver->setAllowedTypes('parameters', ['array']);
        $resolver->setAllowedTypes('attachments', ['array']);
        $resolver->setAllowedTypes('from', 'string');
    }
240758
protected function configureOptions(OptionsResolver $resolver)
    {
        $resolver->remove(['parent_location_id', 'subtree']);
        $resolver->setRequired(['location']);
        $resolver->setDefined([
            'exclude_self',
            'relative_depth',
        ]);

        $resolver->setAllowedTypes('location', [SiteLocation::class]);
        $resolver->setAllowedTypes('exclude_self', ['bool']);
        $resolver->setAllowedTypes('relative_depth', ['int', 'array']);

        $resolver->setDefaults([
            'exclude_self' => true,
        ]);
    }
927257
protected function configureOptions(OptionsResolver $resolver)
    {
        parent::configureOptions($resolver);
        $resolver->setDefaults(
            [
                'allow_reset' => false,   // Allow the reader to reset it's iterator
                'log_count' => false,   // Log in state history the result count
                'empty_log_level' => LogLevel::WARNING,
            ]
        );
        $resolver->setAllowedValues(
            'empty_log_level',
            [
                LogLevel::ALERT,
                LogLevel::CRITICAL,
                LogLevel::DEBUG,
                LogLevel::EMERGENCY,
                LogLevel::ERROR,
                LogLevel::INFO,
                LogLevel::NOTICE,
                LogLevel::WARNING,
            ]
        );
    }
475922
public function addResolver($filter, ResolverInterface $resolver)
    {
        $this->resolvers[$filter] = $resolver;

        if ($resolver instanceof CacheManagerAwareInterface) {
            $resolver->setCacheManager($this);
        }
    }
1123978
public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
    
        $defaultConfigs = array(
            'showOn' => 'button',
            'buttonImageOnly' => true,
            'timeFormat' => 'HH:mm',
            'showSecond' => false,
        );
    
        $resolver->setDefaults(array(
            'translation_domain' => 'ThraceFormBundle',
            'input' => 'datetime',
            'with_seconds' => false,
            'use_meridiem' => false,
            'date_timezone' => null,
            'user_timezone' => null,
            'time_format' => 'H:i',
            'parts' => array('hour', 'minute'),
            'configs' => $defaultConfigs
        ));
    
        $resolver->setNormalizers(array(
            'time_format' => function (Options $options, $value) {
                if ($options->has('with_seconds') && $options->get('with_seconds') === true){
                    return ($options->get('use_meridiem') === true) ? 'h:i:s a' : 'H:i:s';
                } else {
                    return ($options->get('use_meridiem') === true) ? 'h:i a' : 'H:i';
                } 
            },
            'parts' => function (Options $options, $value){
                if ($options->has('with_seconds') && $options->get('with_seconds') === true){
                    return  array('hour', 'minute', 'second');
                } else {
                    return array('hour', 'minute');
                }
            },
            'configs' => function (Options $options, $value) use ($defaultConfigs) {
                $configs = array_replace_recursive($defaultConfigs, $value);

                if (!$options->has('with_seconds') || $options->get('with_seconds') === false){
                    $configs['timeFormat'] =  ($options->get('use_meridiem') === true) ? 'hh:mm tt' : 'HH:mm';
                    $configs['showSecond'] = false;
                } else {
                    $configs['timeFormat'] =  ($options->get('use_meridiem') === true) ? 'hh:mm:ss tt' : 'HH:mm:ss';
                    $configs['showSecond'] = true;
                }

                return $configs;
            }
        ));
    
        $resolver->setAllowedValues(array(
            'input' => array(
                'datetime',
                'string',
                'timestamp',
                'array',
            ),
            'time_format' => array(
                'H:i:s',
                'h:i:s a',
                'H:i',
                'h:i a'
            ),
        ));
    }
793420
public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        
        $defaultConfigs = array(
            'showOn' => 'button',
            'buttonImageOnly' => true,
        );
        
        $resolver->setDefaults(array(
            'input' => 'datetime',
            'format' => 'Y-m-d',
            'date_timezone' => null,
            'user_timezone' => null,
            'translation_domain' => 'ThraceFormBundle',
            'configs' => $defaultConfigs,
    
        ));
        
        $resolver->setNormalizers(array(
            'format' => function (Options $options, $value) {
                return 'Y-m-d';
            },
            'configs' => function (Options $options, $value) use ($defaultConfigs) {
                $configs = array_replace_recursive($defaultConfigs, $value);
                
                $configs['dateFormat'] = 'yy-mm-dd';
                
                return $configs;
            }
        ));

        $resolver->setAllowedValues(array(
            'input' => array(
                'datetime',
                'string',
                'timestamp',
                'array',
            )   
        ));
    }
641517
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(
            array(
                'type'         => 'oo_workflow_profile_transitions',
                'allow_add'    => false,
                'allow_delete' => false,
                'options'      => array(
                    'statuses' => $this->statuses,
                    'locale'       => $this->locale
                )
            )
        );
    }
886093
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(
            [
                'auto_init' => true,
                'max_results' => 0,
                'choices' => [],
                'choice_loader' => null,
                'query_uri' => null,
            ]
        );

        $resolver->setNormalizer(
            'query_uri',
            function (Options $options, $value) {
                if (null !== $value) {
                    return $value;
                }
                /** @var AttributeInterface $attribute */
                $attribute = $options['attribute'];
                if (!$attribute) {
                    $allowedFamilies = $options['allowed_families'];
                    if (1 === \count($allowedFamilies)) {
                        try {
                            /** @var FamilyInterface $family */
                            $family = reset($allowedFamilies);

                            return $this->router->generate(
                                'sidus_autocomplete_api_family_search',
                                [
                                    'familyCode' => $family->getCode(),
                                ]
                            );
                        } catch (ExceptionInterface $e) {
                            throw new \RuntimeException('Unable to generate autocomplete route', 0, $e);
                        }
                    }

                    throw new UnexpectedValueException(
                        'Unable to generate API endpoint without an attribute option or a single allowed family'
                    );
                }
                $family = $attribute->getFamily();
                if (!$family) {
                    throw new UnexpectedValueException(
                        'Unable to generate API endpoint without an attribute option with a family'
                    );
                }
                try {
                    return $this->router->generate(
                        'sidus_autocomplete_api_attribute_search',
                        [
                            'attributePath' => $family->getCode().'.'.$attribute->getCode(),
                        ]
                    );
                } catch (ExceptionInterface $e) {
                    throw new \RuntimeException('Unable to generate autocomplete route', 0, $e);
                }
            }
        );
    }
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');
    }
981149
protected function addAdditionalImage(array $additionalImage, OptionsResolver $resolver)
    {
        $image = $resolver->resolve($additionalImage);
        $this->additionalImages[$image['prefix']] = $image;

        return $this;
    }
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']);
    }