Init options with innerType requirements

@return OptionsResolver
167961
public function getInitOptionsResolver()
    {
        if (null === $this->initOptionsResolver) {
            if (null !== $this->parent) {
                $this->initOptionsResolver = clone $this->parent->getInitOptionsResolver();
            } else {
                $this->initOptionsResolver = new OptionsResolver();
            }

            $this->innerType->setInitOptions($this->initOptionsResolver);

            foreach ($this->typeExtensions as $extension) {
                $extension->setInitOptions($this->initOptionsResolver);
            }
        }

        return $this->initOptionsResolver;
    }
929791
public function configureOptions(OptionsResolver $resolver)
    {
        parent::configureOptions($resolver);
        $resolver->setDefaults(
            [
                'attribute' => null,
                'create_missing' => true,
            ]
        );
        $resolver->setAllowedTypes('attribute', ['NULL', 'string', AttributeInterface::class]);
        $resolver->setAllowedTypes('create_missing', ['bool']);
        $resolver->setNormalizer(
            'attribute',
            function (Options $options, $value) {
                /** @var FamilyInterface $family */
                $family = $options['family'];

                if (null !== $value) {
                    if ($value instanceof AttributeInterface) {
                        if (!$family->hasAttribute($value->getCode())) {
                            throw new \UnexpectedValueException(
                                "Family {$family->getCode()} has no attribute named {$value->getCode()}"
                            );
                        }

                        return $value;
                    }

                    return $family->getAttribute($value);
                }

                if (!array_key_exists($family->getCode(), $this->familyMap)) {
                    throw new \UnexpectedValueException(
                        'Unknown asset family detected, please specify the attribute for resource storage'
                    );
                }

                return $this->familyMap[$family->getCode()];
            }
        );
    }
740120
protected function configureOptions(array $options = [])
    {
        try {
            $resolver = new OptionsResolver();
            // We set all global options as defined options, otherwise we would get a lot of exceptions
            $resolver->setDefined(array_keys($options));
            $this->resolveOptions($resolver);
            return $resolver->resolve($options);
        } catch (MissingOptionsException $e) {
            throw new InvalidConfigurationException($e->getMessage(), $e->getCode());
        } catch (InvalidOptionsException $e) {
            throw new InvalidConfigurationException($e->getMessage(), $e->getCode());
        } catch (NoConfigurationException $e) {
            throw new InvalidConfigurationException($e->getMessage(), $e->getCode());
        } catch (NoSuchOptionException $e) {
            throw new InvalidConfigurationException($e->getMessage(), $e->getCode());
        } catch (OptionDefinitionException $e) {
            throw new InvalidConfigurationException($e->getMessage(), $e->getCode());
        } catch (UndefinedOptionsException $e) {
            throw new InvalidConfigurationException($e->getMessage(), $e->getCode());
        } catch (ExceptionInterface $e) {
            throw new InvalidConfigurationException($e->getMessage(), $e->getCode());
        }
    }
88850
private function resolveOptions(array $options): array
    {
        $optionsResolver = new OptionsResolver();

        $optionsResolver->setDefault('default_value', null);
        $optionsResolver->setDefault('required', false);
        $optionsResolver->setDefault('label', null);
        $optionsResolver->setDefault('groups', []);
        $optionsResolver->setDefault('constraints', []);

        if ($this->type instanceof ParameterTypeInterface) {
            $this->type->configureOptions($optionsResolver);
        }

        $this->configureOptions($optionsResolver);

        $optionsResolver->setRequired(['required', 'default_value', 'label', 'groups', 'constraints']);

        $optionsResolver->setAllowedTypes('required', 'bool');
        $optionsResolver->setAllowedTypes('label', ['string', 'null', 'bool']);
        $optionsResolver->setAllowedTypes('groups', 'array');
        $optionsResolver->setAllowedTypes('constraints', 'array');

        // @deprecated Replace with "string[]" allowed type when support for Symfony 2.8 ends
        $optionsResolver->setAllowedValues(
            'groups',
            static function (array $groups): bool {
                foreach ($groups as $group) {
                    if (!is_string($group)) {
                        return false;
                    }
                }

                return true;
            }
        );

        $optionsResolver->setAllowedValues(
            'constraints',
            function (array $constraints): bool {
                return $this->validateConstraints($constraints);
            }
        );

        $optionsResolver->setNormalizer(
            'groups',
            function (Options $options, array $value): array {
                if (!$this->parentBuilder instanceof ParameterBuilderInterface) {
                    return $value;
                }

                if (!$this->parentBuilder->getType() instanceof CompoundParameterTypeInterface) {
                    return $value;
                }

                return $this->parentBuilder->getGroups();
            }
        );

        $optionsResolver->setAllowedValues(
            'label',
            static function ($value): bool {
                if (!is_bool($value)) {
                    return true;
                }

                return $value === false;
            }
        );

        $resolvedOptions = $optionsResolver->resolve($options);

        $this->isRequired = $resolvedOptions['required'];
        $this->defaultValue = $resolvedOptions['default_value'];
        $this->label = $resolvedOptions['label'];
        $this->groups = $resolvedOptions['groups'];
        $this->constraints = $resolvedOptions['constraints'];

        unset(
            $resolvedOptions['required'],
            $resolvedOptions['default_value'],
            $resolvedOptions['label'],
            $resolvedOptions['groups'],
            $resolvedOptions['constraints']
        );

        return $resolvedOptions;
    }
389251
function buildResolverOptions(options, base) {
  var pathFilter = options.pathFilter;

  options.basedir = base;
  options.pathFilter = function(info, resvPath, relativePath) {
    if (relativePath[0] !== '.') {
      relativePath = './' + relativePath;
    }
    var mappedPath;
    if (pathFilter) {
      mappedPath = pathFilter.apply(this, [info, resvPath, path.normalize(relativePath)]);
    }
    if (mappedPath) {
      return mappedPath;
    }
    return;
  };
  return options;
}
883511
public function getResolver(){
		if(!isset($this->resolver)){
			$this->resolver = new MultiTypeResolver($this->container, getcwd());
		}
		return $this->resolver;
	}
792674
protected function resolveOptions(): void
    {
        $resolver = new OptionsResolver();
        $this->configureOptions($resolver);
        $this->options = $resolver->resolve($this->options);
    }
470118
function setResolverOptions($options)
    {
        if (method_exists($this->_resolver(), 'with'))
            $this->_resolver()->with($options);

        return $this;
    }
240136
protected function configureOptions(OptionsResolver $options): void
    {
        $distanceAllowedValues = function ($value) {
            return !($value < 500 || $value > 20000);
        };

        $options->setRequired(['origin', 'dest']);

        $options->setDefined([
            'via',
            'useTog', 'useBus', 'useMetro', 'useBicycle',
            'maxWalkingDistanceDep', 'maxWalkingDistanceDest',
            'maxCyclingDistanceDep', 'maxCyclingDistanceDest',
            'date',
        ]);

        $options->setAllowedTypes('origin', [LocationResponse::class, StopLocationResponse::class]);
        $options->setAllowedTypes('dest', [LocationResponse::class, StopLocationResponse::class]);
        $options->setAllowedTypes('via', [LocationResponse::class, StopLocationResponse::class]);

        $options->setAllowedValues('useTog', [0, 1]);
        $options->setAllowedValues('useBus', [0, 1]);
        $options->setAllowedValues('useMetro', [0, 1]);
        $options->setAllowedValues('useBicycle', [0, 1]);

        $options->setAllowedValues('maxWalkingDistanceDep', $distanceAllowedValues);
        $options->setAllowedValues('maxWalkingDistanceDest', $distanceAllowedValues);
        $options->setAllowedValues('maxCyclingDistanceDep', $distanceAllowedValues);
        $options->setAllowedValues('maxCyclingDistanceDest', $distanceAllowedValues);

        $options->setAllowedTypes('date', \DateTime::class);
    }
66983
public function setRequirements()
    {
        if (!isset($this->options['requirements']) || $this->options['requirements'] === null) {
            return $this;
        }

        $requirements = $this->options['requirements'];

        if (!is_array($requirements)) {
            $requirements = [$requirements];
        }

        foreach ($requirements as $constraint) {
            $this->requirements[] = $constraint;
        }

        unset($this->options['requirements']);

        return $this;
    }
293612
protected function configureResolver(OptionsResolver $resolver)
    {
        $resolver
            ->setRequired(['_id', '_type', '_source'])
            ->setDefaults(['_score' => null, 'fields' => []])
            ->addAllowedTypes('_id', ['integer', 'string'])
            ->addAllowedTypes('_type', 'string')
            ->addAllowedTypes('_source', 'array')
            ->addAllowedTypes('fields', 'array');
    }
1178534
private function configureStartControlProperties(OptionsResolver $resolver)
    {
        $resolver->setDefined('autostart')
            ->setAllowedTypes('autostart', 'bool');

        $resolver
            ->setDefined('autorestart')
            ->setAllowedTypes('autorestart', ['bool', 'string'])
            ->setAllowedValues('autorestart', [true, false, 'true', 'false', 'unexpected'])
            ->setNormalizer('autorestart', function (Options $options, $value) {
                return (is_bool($value) or $value === 'unexpected') ? $value : ($value === 'true' ? true : false);
            });

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

        $resolver->setDefined('startretries')
            ->setAllowedTypes('startretries', 'int');
    }
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)));
            },
        ]);
    }
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);
    }
499397
public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $defaultConfigs = $this->options;
    
        $resolver->setDefaults(array(
            'translation_domain' => 'ThraceFormBundle',
            'configs' => $defaultConfigs          
        ));
        
        $resolver->setNormalizers(array(
            'configs' => function (Options $options, $value) use ($defaultConfigs){
                $configs = array_replace_recursive($defaultConfigs, $value);

                return $configs;
            }
        ));
    }
345135
protected function setResolverOptions($options)
    {
        $resolver = $this->resolver();
        $resolver->with($resolver::parseWith($options));
    }
573364
private function configureStartControlProperties(OptionsResolver $resolver)
    {
        $resolver->setDefined('autostart');
        $this->configureBooleanProperty('autostart', $resolver);


        $resolver
            ->setDefined('autorestart')
            ->setAllowedTypes('autorestart', ['bool', 'string'])
            ->setAllowedValues('autorestart', [true, false, 'true', 'false', 'unexpected'])
            ->setNormalizer('autorestart', function (Options $options, $value) {
                return (is_bool($value) or $value === 'unexpected') ? $value : ($value === 'true' ? true : false);
            });

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

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