Configures process related properties

@param OptionsResolver $resolver
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);
    }
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')
        ;
    }
942351
private function configureStdoutLogProperties(OptionsResolver $resolver)
    {
        $resolver
            ->setDefined('stdout_logfile')
            ->setAllowedTypes('stdout_logfile', 'string');

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

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

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

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

        $resolver->setDefined('stdout_syslog')
            ->setAllowedTypes('stdout_syslog', 'bool');
    }
345135
protected function setResolverOptions($options)
    {
        $resolver = $this->resolver();
        $resolver->with($resolver::parseWith($options));
    }
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)));
            },
        ]);
    }
284360
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver
            ->setDefaults([
                'type' => TextType::class,
                'options' => [],
                'comparator' => 'like',
                'operator' => 'or',
            ])
            ->setRequired('name')
            ->setAllowedTypes('name', 'string')
            ->setAllowedTypes('type', 'string')
            ->setAllowedTypes('options', 'array')
            ->setAllowedTypes('comparator', 'string')
            ->setAllowedTypes('operator', 'string')
            ->setAllowedValues('operator', [
                'and',
                'or',
            ])
        ;
    }
845849
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(
            [
                'widget' => 'single_text',
                'widget_position' => 'right',
                'html5' => false,
                'locale' => $this->locale,
                'format' => null,
                'date_type' => \IntlDateFormatter::SHORT,
                'time_type' => \IntlDateFormatter::SHORT,
            ]
        );
        $resolver->setNormalizer(
            'format',
            function (Options $options, $value) {
                if (null !== $value) {
                    return $value;
                }
                $locale = $options['locale'] ?: 'en';
                $formatter = \IntlDateFormatter::create(
                    $locale,
                    $options['date_type'],
                    $options['time_type']
                );

                return $formatter->getPattern();
            }
        );
    }
1292927
public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $defaultConfigs = array(
            'datagrid_exists' => $this->datagridExists,   
        );
        
        $resolver->setDefaults(array(
            'allow_add' => true,
            'allow_delete' => true,
            'prototype' => true,
            'by_reference' => false,
            'type' => 'thrace_multi_select',
            'translation_domain' => 'ThraceFormBundle',
            'configs' => $defaultConfigs,
        ));
        
        $resolver->setNormalizers(array(            
            'configs' => function (Options $options, $value) use ($defaultConfigs){
                $configs = array_replace_recursive($defaultConfigs, $value);
                return $configs;
            }
        ));
          
        $resolver->setRequired(array('grid'));
        
        $resolver->setAllowedTypes(array(
            'grid' => array('object'),
        ));
    }
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']);
    }
878000
protected function resolveOptions(OptionsResolver $resolver)
    {
        $resolver->setRequired('directories');
        $resolver->setDefault('baseDirectory', null);
        $resolver->setAllowedTypes('directories', 'array');
    }
97663
protected function configureByteProperty($property, OptionsResolver $resolver)
    {
        $resolver
            ->setAllowedTypes($property, 'byte')
            ->setNormalizer($property, function (Options $options, $value) {
                return is_numeric($value) ? intval($value) : $value;
            });
    }
409801
protected function configureBooleanProperty($property, OptionsResolver $resolver)
    {
        $resolver
            ->setAllowedTypes($property, ['bool', 'string'])
            ->setAllowedValues($property, [true, false, 'true', 'false'])
            ->setNormalizer($property, function (Options $options, $value) {
                return is_bool($value) ? $value : ($value === 'true' ? true : false);
            });
    }
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;
            }
        );
    }
232233
protected function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setRequired(
            [
                'family',
            ]
        );
        /** @noinspection PhpUnusedParameterInspection */
        $resolver->setNormalizer(
            'family',
            function (Options $options, $value) {
                if ($value instanceof FamilyInterface) {
                    return $value;
                }

                return $this->familyRegistry->getFamily($value);
            }
        );
        $resolver->setAllowedTypes('family', ['string', FamilyInterface::class]);
    }
561753
public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        parent::setDefaultOptions($resolver);

        $resolver
            ->setDefaults(array(
                'precision' => function(Options $options, $previous)
                {
                    if(null !== ($precision = $options['field']->getPrecision()))
                    {
                        return $precision;
                    }
                    return $previous;
                }
        ));
    }
578187
protected function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setRequired(
            array(
                'file',
                'document_columns',
                'category_column'
            )
        );

        $resolver->setOptional(
            array(
                'limit',
                'delimiter',
                'enclosure',
                'escape',
                'category_modifier'
            )
        );

        $resolver->setDefaults(
            array(
                'limit' => false,
                'length' => 0,
                'delimiter' => ',',
                'enclosure' => '"',
                'escape' => '\\',
                'category_modifier' => false
            )
        );

        $resolver->setAllowedTypes(
            array(
                'file' => 'string',
                'document_columns' => 'array',
                'category_column' => 'string',
                'length' => 'int',
                'delimiter' => 'string',
                'enclosure' => 'string',
                'escape' => 'string'
            )
        );
    }
1223502
public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setRequired(
            [
                'family',
            ]
        );
        $resolver->setAllowedTypes('family', ['string', FamilyInterface::class]);
        $resolver->setDefaults(
            [
                'repository' => null,
                'ignore_missing' => true,
            ]
        );
        $resolver->setAllowedTypes('repository', ['NULL', DataRepository::class]);
        $resolver->setAllowedTypes('ignore_missing', ['bool']);

        /** @noinspection PhpUnusedParameterInspection */
        $resolver->setNormalizer(
            'family',
            function (Options $options, $value) {
                if ($value instanceof FamilyInterface) {
                    return $value;
                }

                return $this->familyRegistry->getFamily($value);
            }
        );
        $resolver->setNormalizer(
            'repository',
            function (Options $options, $value) {
                if ($value instanceof DataRepository) {
                    return $value;
                }
                /** @var FamilyInterface $family */
                $family = $options['family'];

                return $this->entityManager->getRepository($family->getDataClass());
            }
        );
    }