Get the applicable methods based on the options.

@param  array  $options
@return array
167555
protected function getMethods($options)
	{
		if (isset($options['only']) && count($options['only']) > 0)
		{
			return $options['only'];
		}
		elseif (isset($options['except']) && count($options['except']) > 0)
		{
			return array_diff($this->defaults, $options['except']);
		}

		return $this->defaults;
	}
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;
    }
812174
protected function normalizeOptions(array $options)
    {
        return array_merge([
            'ulClass'      => $this->ulClass,
            'addClassToLi' => $this->addClassToLi,
            'iconPosition' => $this->iconPosition,
            ], $options);
    }
821309
public function map(array $options = [])
	{
		return self::$mapper->map($this->getLatitude(), $this->getLongitude(), $options);
	}
209517
public function addOptions(array $options) : Getopt
    {
        if (!empty($this->options)){
            $this->options = array_merge($this->options, $options);
        }
        else{
            $this->options = $options;
        }
        return $this;
    }
807057
protected function getServers(array $options)
    {
        if (! array_key_exists('on', $options)) {
            $options['on'] = [];
        }

        return Arr::flatten(array_map(function ($name) {
            return $this->getServer($name);
        }, (array) $options['on']));
    }
554106
private function getMergedOptions(array $options)
    {
        $options = array_merge(
            $this->getDefaultOptions(),
            $options
        );

        if (isset($options['formats'])) {
            $options['formats'] = self::mergeFormats($this->getDefaultFormats(), $options['formats']);
        } else {
            $options['formats'] = $this->getDefaultFormats();
        }

        if (is_null($options['line_ending'])) {
            $options['line_ending'] = $options['type'] === 'html' ? '<br/>' : "\n";
        }

        if (is_null($options['indentation'])) {
            $options['indentation'] = $options['type'] === 'html' ? '&nbsp;&nbsp;&nbsp;&nbsp;' : '    ';
        }

        // `parts_newline` requires `clause_newline`
        $options['parts_newline'] &= $options['clause_newline'];

        return $options;
    }
468077
public function getCheckboxes(array $options=[]) {
		if(isset($options['choices']))
			$choices = $options['choices'];
		else
			$choices = $this->getChoices();

		$checkboxes = [];
		foreach($choices as $k=>$v) {
			$checkbox_options = $options;
			$checkbox_options['value'] = $k;
			$checkbox_options['widget_name'] = $v;
			$checkboxes[$k] = $this->getCheckbox($v, $checkbox_options);
		}
		return $checkboxes;
	}
1200695
public function getFilterOptions(array $options = array()) {
		$options['types'] = $this->comment->getType();
		$options['subtypes'] = array($this->comment->getSubtype(), 'hjcomment');
		$options['container_guids'] = $this->comment->container_guid;
		if (!isset($options['order_by'])) {
			$options['order_by'] = 'e.guid ASC';
		}
		return $options;
	}
852758
protected function processOptions(array $options)
    {
        $resolver = new OptionsResolver();
        $this->setDefaultOptions($resolver);

        return $resolver->resolve($options);
    }
247937
protected function resolvePageOptions(array $options = array())
    {
        $resolver = new OptionsResolver;
        $this->setDefaultPageOptions($resolver);

        if (!empty($this->pageOptions)) {
            $resolver->setDefaults($this->pageOptions);
        }

        return $resolver->resolve($options);
    }
142263
public function options($options = [])
    {
        // remote options
        if (is_string($options)) {
            // reload selected
            if (class_exists($options) && in_array(Model::class, class_parents($options))) {
                return $this->model(...func_get_args());
            }

            return $this->loadRemoteOptions(...func_get_args());
        }

        if ($options instanceof Arrayable) {
            $options = $options->toArray();
        }

        if (is_callable($options)) {
            $this->options = $options;
        } else {
            $this->options = (array) $options;
        }

        return $this;
    }
515175
protected function parseOptions(array $options): array
    {
        $this->setTransformer(new NumberToLocalizedStringTransformer($this->getLocale(), $this));

        return parent::parseOptions($options);
    }
1322756
protected function getPrestaShopOptions(array $options)
    {
        $result = array(
            'query' => array(),
            'id' => 'id',
            'name' => 'name',
        );

        foreach ($options as $value => $label) {
            $result['query'][] = array(
                'id' => $value,
                'name' => $label,
            );
        }

        return $result;
    }
1041641
private function getValidatorOptions(array $options)
    {
        $resolver = new OptionsResolver();
        $resolver->setDefaults([
            'groups' => null,
            'traverse' => false,
            'deep' => false,
        ]);

        return $resolver->resolve(isset($options['validator']) ? $options['validator'] : []);
    }
329698
protected function normalizeOptions(array $options)
    {
        return array_merge(parent::normalizeOptions($options), [
            'inverse'   => $this->inverse,
            'fixed'     => $this->fixed,
            'static'    => $this->static,
            'brand'     => $this->brand,
            'useForm'   => $this->useForm,
            'rightMenu' => $this->rightMenu,
            ], $options);
    }
855417
private function getOptions(array $options, array $allowed): array
    {
        $result = [];
        foreach ($options as $key => $value) {
            if (\in_array($key, $allowed, false)) {
                $result[$key] = $value;
            }
        }
        return $result;
    }