Configure the options.

@param OptionsResolver $options
170081
protected function configureOptions(OptionsResolver $options): void
    {
        $options->setRequired(['input', 'include_stops', 'include_addresses', 'include_pois']);
        $options->setAllowedTypes('input', ['string', 'int', 'float']);
        $options->setAllowedTypes('include_stops', 'bool');
        $options->setAllowedTypes('include_addresses', 'bool');
        $options->setAllowedTypes('include_pois', 'bool');

        $options->setDefault('include_stops', true);
        $options->setDefault('include_addresses', true);
        $options->setDefault('include_pois', true);
    }
1119310
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver
            ->setDefaults([
                'title' => null,
                'class' => Action::class,
                'fields' => [],
                'permissions' => [
                    'ROLE_ADMIN',
                ],
                'export' => [],
                'order' => [],
                'route' => $this->generateRouteName(),
                'route_parameters' => [],
                'route_path' => $this->getDefaultRoutePath(),
                'route_requirements' => [],
                'route_defaults' => [
                    '_controller' => AdminAction::class,
                ],
                'icon' => null,
                'load_strategy' => LAGAdminBundle::LOAD_STRATEGY_NONE,
                'pager' => $this->adminConfiguration->getParameter('pager'),
                'page_parameter' => $this->adminConfiguration->getParameter('page_parameter'),
                'max_per_page' => 30,
                'criteria' => [],
                'filters' => [],
                'menus' => [],
                'template' => $this->getDefaultTemplate(),
                'sortable' => false,
                'string_length' => $this->adminConfiguration->getParameter('string_length'),
                'string_length_truncate' => $this->adminConfiguration->getParameter('string_length_truncate'),
                'date_format' => $this->adminConfiguration->getParameter('date_format'),
                'use_form' => true,
                'form' => null,
            ])
            ->setAllowedTypes('title', [
                'string',
                'null',
            ])
            ->setAllowedTypes('class', 'string')
            ->setAllowedTypes('fields', 'array')
            ->setAllowedTypes('permissions', 'array')
            ->setAllowedTypes('export', 'array')
            ->setAllowedTypes('order', 'array')
            ->setAllowedTypes('route', 'string')
            ->setAllowedTypes('route_parameters', 'array')
            ->setAllowedTypes('route_path', 'string')
            ->setAllowedTypes('route_defaults', 'array')
            ->setAllowedTypes('route_requirements', 'array')
            ->setAllowedTypes('string_length', 'integer')
            ->setAllowedTypes('string_length_truncate', 'string')
            ->setNormalizer('fields', $this->getFieldsNormalizer())
            ->setNormalizer('order', $this->getOrderNormalizer())
            ->setNormalizer('load_strategy', $this->getLoadStrategyNormalizer())
            ->setNormalizer('criteria', $this->getCriteriaNormalizer())
            ->setNormalizer('menus', $this->getMenuNormalizer())
            ->setNormalizer('filters', $this->getFiltersNormalizer())
            ->setNormalizer('route_defaults', $this->getRouteDefaultNormalizer())
            ->setNormalizer('form', $this->getFormNormalizer())
            ->setNormalizer('title', $this->getTitleNormalizer())
            ->setAllowedValues('load_strategy', [
                LAGAdminBundle::LOAD_STRATEGY_NONE,
                LAGAdminBundle::LOAD_STRATEGY_UNIQUE,
                LAGAdminBundle::LOAD_STRATEGY_MULTIPLE,
            ])
            ->setAllowedValues('pager', [
                'pagerfanta',
                false,
                null,
            ])
        ;
    }
777372
public function configureOptionsResolver(OptionsResolver $resolver)
    {
        parent::configureOptionsResolver($resolver);
        $resolver->setDefaults([
            self::OPTION_TTL => $this->defaultTTL,
            self::OPTION_PERSISTENT => $this->defaultPersistence,
            self::OPTION_PRIORITY => 4,
            self::OPTION_EXCHANGE_PATTERN => self::EXCHANGE_PATTERN_IN_ONLY,
            self::OPTION_TRACK => true,
            self::OPTION_PREFIX => '',
        ]);

        $resolver->setRequired([
            self::OPTION_TTL, self::OPTION_PERSISTENT, self::OPTION_PRIORITY, self::OPTION_PREFIX,
            self::OPTION_QUEUE_DRIVER, self::OPTION_QUEUE_NAME,
        ]);

        $resolver->setAllowedTypes(self::OPTION_TTL, ['numeric']);
        $resolver->setAllowedValues(self::OPTION_PERSISTENT, [true, false, 'true', 'false', 0, 1, '0', '1']);
        $resolver->setAllowedTypes(self::OPTION_PERSISTENT, ['numeric', 'string', 'boolean']);
        $resolver->setAllowedTypes(self::OPTION_PRIORITY, ['numeric']);
        $resolver->setAllowedTypes(self::OPTION_PREFIX, ['string']);
        $resolver->setAllowedTypes(self::OPTION_QUEUE_DRIVER, ['string']);
    }
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']);
    }
1347089
private function configureOptions(OptionsResolver $optionsResolver)
    {
        $optionsResolver
            ->setRequired([
                'language',
                'contentType',
            ])
            ->setDefined(['baseLanguage'])
            ->setAllowedTypes('contentType', ContentType::class)
            ->setAllowedTypes('baseLanguage', ['null', Language::class])
            ->setAllowedTypes('language', Language::class);
    }
572858
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');
        $this->configureIntegerProperty('stopwaitsecs', $resolver);

        $resolver->setDefined('stopasgroup');
        $this->configureBooleanProperty('stopasgroup', $resolver);

        $resolver->setDefined('killasgroup');
        $this->configureBooleanProperty('killasgroup', $resolver);
    }
414801
private function resolveConfiguration(array $options = []): void
    {
        $resolver = new OptionsResolver();
        $this->configureOptions($resolver);
        $options = $resolver->resolve($options);
        $this->userAgentPrefix = $options[static::CONFIG_USER_AGENT_PREFIX];
        $this->httpClientBuilder = $options[static::CONFIG_HTTP_CLIENT_BUILDER] ?: new Builder();
        $this->uriFactory = $options[static::CONFIG_URI_FACTORY] ?: UriFactoryDiscovery::find();
        $this->requestFactory = $options[static::CONFIG_REQUEST_FACTORY] ?: MessageFactoryDiscovery::find();
        $this->journal = $options[static::CONFIG_JOURNAL] ?: new Journal();
        $this->errorFormatter = $options[static::CONFIG_ERROR_FORMATTER];
        $this->retryPluginConfig = $options[static::CONFIG_RETRY_PLUGIN_CONFIG];
    }
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')
        ;
    }
857331
protected function configureOptions(array $options)
    {
        $resolver = new OptionsResolver();

        $resolver->setDefaults([
            'adapter'          => null,
            'secure'           => true,
            'host'             => self::TMDB_URI,
            'base_url'         => null,
            'token'            => null,
            'session_token'    => null,
            'event_dispatcher' => array_key_exists('event_dispatcher', $this->options) ? $this->options['event_dispatcher'] : new EventDispatcher(),
            'cache'            => [],
            'log'              => [],
        ]);

        $resolver->setRequired([
            'adapter',
            'host',
            'token',
            'secure',
            'event_dispatcher',
            'cache',
            'log'
        ]);

        $resolver->setAllowedTypes('adapter', ['object', 'null']);
        $resolver->setAllowedTypes('host', ['string']);
        $resolver->setAllowedTypes('secure', ['bool']);
        $resolver->setAllowedTypes('token', ['object']);
        $resolver->setAllowedTypes('session_token', ['object', 'null']);
        $resolver->setAllowedTypes('event_dispatcher', ['object']);

        $this->options = $resolver->resolve($options);

        $this->postResolve($options);

        return $this->options;
    }
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);
            }
        );
    }
137652
private function configureStderrLogProperties(OptionsResolver $resolver)
    {
        $resolver
            ->setDefined('stderr_logfile')
            ->setAllowedTypes('stderr_logfile', 'string');

        $resolver->setDefined('stderr_logfile_maxbytes');
        $this->configureByteProperty('stderr_logfile_maxbytes', $resolver);

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

        $resolver->setDefined('stderr_capture_maxbytes');
        $this->configureByteProperty('stderr_capture_maxbytes', $resolver);

        $resolver->setDefined('stderr_events_enabled');
        $this->configureBooleanProperty('stderr_events_enabled', $resolver);

        $resolver->setDefined('stderr_syslog');
        $this->configureBooleanProperty('stderr_syslog', $resolver);
    }
1131240
public function setOptions(array $options = []): void
    {
        $this->options = $this->shortcuts = [];
        $this->addOptions($options);
    }
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() . '__';
        });
    }
808435
protected function configureOptions(OptionsResolver $options): void
    {
        $options->setRequired('id');
        $options->setAllowedTypes('id', ['string']);
        $options->setDefined(['date', 'time', 'useTog', 'useBus', 'useMetro']);

        $options->addAllowedTypes('date', \DateTime::class);
        $options->setAllowedValues('useTog', [0, 1]);
        $options->setAllowedValues('useBus', [0, 1]);
        $options->setAllowedValues('useMetro', [0, 1]);
    }
254810
protected function setOptions(array $options = []): void
    {
        $this->options = $options;
        $this->configName = empty($options['cacheConfig']) ? static::DEFAULT_CONFIG : (string)$options['cacheConfig'];
        $this->skipCache = empty($this->options['cacheSkip']) ? false : (bool)$this->options['cacheSkip'];
    }
1025974
protected function configure(array $options): void
    {
        $options = array_merge([
            'socket_class' => ClientSocket::class,
            'on_data_callback' => null,
            'socket_options' => [],
        ], $options);

        parent::configure($options);
    }
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'))
        ;
    }