Configures stop control related properties.

@param OptionsResolver $resolver
480590
private function configureStopControlProperties(OptionsResolver $resolver)
    {
        $resolver->setDefined('exitcodes');
        $this->configureArrayProperty('exitcodes', $resolver);

        $resolver
            ->setDefined('stopsignal')
            ->setAllowedTypes('stopsignal', 'string')
            ->setAllowedValues('stopsignal', ['TERM', 'HUP', 'INT', 'QUIT', 'KILL', 'USR1', 'USR2']);

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

        $resolver->setDefined('stopasgroup')
            ->setAllowedTypes('stopasgroup', 'bool');

        $resolver->setDefined('killasgroup')
            ->setAllowedTypes('killasgroup', 'bool');
    }
1133786
protected function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(array(
            'csrf_parameter' => '_csrf_token',
            'csrf_protection' => true,
            'collection_type' => FormCollectionInterface::COLLECTION_TYPE_ALL,
            'locale' => 'en_EN',
            'fallback_locales' => array('en_EN'),
            'translator_paths' => array(),
            'config_paths' => array(),
            'validation_groups' => null
        ));

        $resolver->setAllowedValues('collection_type', array(FormCollectionInterface::COLLECTION_TYPE_ALL, FormCollectionInterface::COLLECTION_TYPE_ANY, FormCollectionInterface::COLLECTION_TYPE_MANY, FormCollectionInterface::COLLECTION_TYPE_ONE));
    }
455724
public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        
        $defaultConfigs = array(
            'width' => '300px',
            'allowClear' => true,  
        );
        
        $defaults = array(
            'multiple' => false,
            'expanded' => false,
            'empty_value' => 'select.empty_value',
            'translation_domain' => 'ThraceFormBundle',
            'configs' => $defaultConfigs
        );
        
        $normalizers = array(
            'expanded' => function (Options $options, $value) {
                return false;
            },           
            'configs' => function (Options $options, $value) use ($defaultConfigs) {
                $configs = array_replace_recursive($defaultConfigs, $value);
                
                $configs['placeholder'] = $options->get('empty_value');
                
                if(true === $options->get('multiple') && isset($configs['ajax'])){
                    $configs['multiple'] = true;
                }

                return $configs;
            }
        );
         
        $resolver->setDefaults($defaults);
        
        $resolver->setNormalizers($normalizers);
    }
429671
public function configureOptions(OptionsResolver $resolver)
    {
        $multiLanguagesChoiceManage = $this->multiLanguagesChoiceManager;
        $resolver->setDefaults(
            array(
                'multiple' => true,
                'expanded' => true,
                'required' => false,
                'class' => $this->workflowFunctionClass,
                'choice_label' => function (WorkflowFunctionInterface $choice) use ($multiLanguagesChoiceManage) {
                    return $multiLanguagesChoiceManage->choose($choice->getNames());
                },
            )
        );
    }
416607
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setRequired(
            [
                'admin_action',
            ]
        );
        $resolver->setAllowedTypes('admin_action', ['string', Action::class]);
        $resolver->setDefaults(
            [
                'admin' => null,
            ]
        );
        $resolver->setAllowedTypes('admin', ['NULL', 'string', Admin::class]);
        $resolver->setNormalizer(
            'admin',
            function (Options $options, $value) {
                if ($value instanceof Admin) {
                    return $value;
                }
                if (null === $value) {
                    return $this->adminRegistry->getCurrentAdmin();
                }

                return $this->adminRegistry->getAdmin($value);
            }
        );
        $resolver->setNormalizer(
            'admin_action',
            function (Options $options, $value) {
                /** @var Admin $admin */
                $admin = $options['admin'];

                if ($value instanceof Action) {
                    if ($value->getAdmin() !== $admin) {
                        throw new \LogicException(
                            "Wrong Admin for Action {$value->getCode()}: {$value->getAdmin()->getCode()}"
                        );
                    }

                    return $value;
                }

                return $admin->getAction($value);
            }
        );
        $resolver->setNormalizer(
            'uri',
            function (Options $options, $value) {
                if (null === $value) {
                    return $this->adminRouter->generateAdminPath(
                        $options['admin'],
                        $options['admin_action']->getCode(),
                        $options['route_parameters']
                    );
                }

                return $value;
            }
        );
    }
132657
public function setDefaultOptions(OptionsResolver $resolver)
    {
        foreach ($this->middlewares as $middleware) {
            if ($middleware instanceof ConfigurableInterface) {
                $middleware->setDefaultOptions($resolver);
            }
        }
    }
1304206
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(
            [
                'hierarchy' => $this->roleHierarchy->getTreeHierarchy(),
                'required' => false,
            ]
        );
        $resolver->setNormalizer(
            'hierarchy',
            function (Options $options, $value) {
                $error = "'hierarchy' option must be a LeafRole or an array of LeafRole";
                if (!$value instanceof \Traversable && !$value instanceof LeafRole) {
                    throw new \UnexpectedValueException($error);
                }
                if (\is_array($value) || $value instanceof \Traversable) {
                    /** @var array $value */
                    foreach ($value as $item) {
                        if (!$item instanceof LeafRole) {
                            throw new \UnexpectedValueException($error);
                        }
                    }
                }

                return $value;
            }
        );
    }
755930
private function configureLogProperties(OptionsResolver $resolver)
    {
        $resolver->setDefined('redirect_stderr')
            ->setAllowedTypes('redirect_stderr', 'bool');

        $this->configureStdoutLogProperties($resolver);
        $this->configureStderrLogProperties($resolver);
    }
1280465
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver
            ->setDefaults(array(
                'required'               => false,
                'data_extraction_method' => 'default',
                'reference_type'         => 'one',
                'reference_name'         => null,
            ))
            ->setRequired(array('reference_type'))
            ->setAllowedValues('data_extraction_method', array('default'))
            ->setAllowedValues('reference_type', array('one', 'many'))
        ;
    }
1320177
protected function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setRequired('content');
        $resolver->setAllowedTypes('content', SiteContent::class);

        $resolver->setDefined('exclude_self');
        $resolver->setAllowedTypes('exclude_self', ['bool']);
        $resolver->setDefaults([
            'exclude_self' => true,
        ]);
    }
759249
protected function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setRequired(array());

        $resolver->setDefaults(array(
            'id' => null,
            'css' => null,
            'charset' => 'UTF-8',
            'domain' => $title = $this->getSetting('domain'),
            'title' => $title = $this->getSetting('title'),
            'locale' => $this->getSetting('locale'),
            'metas' => array(
                'keywords' => $keywords = $this->getSetting('meta_keywords'),
                'description' => $description = $this->getSetting('meta_description'),
                'robots' => $this->getSetting('meta_robots'),
            ),
            'blocks' => null,
            'styles' => null,
            'scripts' => null,
            'keywords' => $keywords,
            'description' => $description,
            'breadcrumbs' => null,
            'reset_script' => false,
            'reset_style' => false,
            'reset_meta' => false,
            'reset_breadcrumb' => false,
            'heading' => null,
            'icon' => null,
            'canonical' => null,
            'inited' => false,
            'extras' => array(),
        ));

        $resolver->setAllowedTypes(array(
            'inited' => array('boolean'),
            'heading' => array('null', 'string'),
            'icon' => array('null', 'string'),
            'metas' => array('null', 'array'),
            'blocks' => array('null', 'array'),
            'extras' => array('null', 'array'),
        ));
    }
506584
public function configureOptions(OptionsResolver $resolver)
    {
        $that = $this;

        if (!interface_exists(ChoiceLoaderInterface::class)) {
            $resolver->setDefaults([
                'context' => null,
                'category' => null,
                'choice_list' => static function (Options $opts, $previousValue) use ($that) {
                    return new SimpleChoiceList($that->getChoices($opts));
                },
            ]);

            return;
        }
        $resolver->setDefaults([
            'context' => null,
            'category' => null,
            'choice_loader' => static function (Options $opts, $previousValue) use ($that) {
                return new CategoryChoiceLoader(array_flip($that->getChoices($opts)));
            },
        ]);
    }
591535
public function configureOptionsResolver(OptionsResolver $resolver)
    {
        parent::configureOptionsResolver($resolver);
        $resolver->setRequired([
            self::OPTION_NOSQL_DRIVER,
            self::OPTION_COLLECTION_PREFIX,
            self::OPTION_COLLECTION_NAME,
            self::OPTION_METHOD
        ]);

        $resolver->setAllowedTypes(self::OPTION_COLLECTION_NAME, ['string']);
        $resolver->setAllowedTypes(self::OPTION_COLLECTION_PREFIX, ['string']);
        $resolver->setAllowedTypes(self::OPTION_NOSQL_DRIVER, ['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']);
    }
1216329
protected function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setRequired([
            'client_id',
            'client_secret',
            'authorization_url',
            'access_token_url',
            'infos_url',
        ]);

        $resolver->setDefaults([
            'scope' => null,
            'csrf' => false,
            'user_response_class' => PathUserResponse::class,
            'auth_with_one_url' => false,
        ]);

        $resolver->setAllowedValues('csrf', [true, false]);
    }
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,
        ]);
    }
485461
public function configureOptions(OptionsResolver $resolver)
    {
        $this->fixDoctrineQueryBuilderNormalizer($resolver);

        $queryBuilder = function (EntityRepository $repository, $options) {
            $qb = $repository->createQueryBuilder('d');
            if (!empty($options['allowed_families'])) {
                /** @var FamilyInterface[] $families */
                $families = $options['allowed_families'];
                $familyCodes = [];
                foreach ($families as $family) {
                    $familyCodes[] = $family->getCode();
                }

                $qb
                    ->andWhere('d.family IN (:allowedFamilies)')
                    ->setParameter('allowedFamilies', $familyCodes);
            }
            $qb->setMaxResults($options['max_results']);

            return $qb;
        };

        $resolver->setDefaults(
            [
                'em' => $this->entityManager,
                'class' => $this->dataClass,
                'query_builder' => $queryBuilder,
                'max_results' => 100,
            ]
        );

        $this->allowedFamiliesOptionConfigurator->configureOptions($resolver);
    }