Get the valid attributes from the options.

@param array $options

@return array
327268
public function extractAttributes($options = [])
    {
        if (!is_array($options)) {
            $options = [];
        }

        if (count($this->groupStack) > 0) {
            $options = $this->mergeWithLastGroup($options);
        }

        return Arr::except($options, $this->reserved);
    }
812174
protected function normalizeOptions(array $options)
    {
        return array_merge([
            'ulClass'      => $this->ulClass,
            'addClassToLi' => $this->addClassToLi,
            'iconPosition' => $this->iconPosition,
            ], $options);
    }
621152
public function getChoices(Options $options)
    {
        if (!$options['site'] instanceof SiteInterface) {
            return [];
        }

        $filter_choice = array_merge([
            'current_page' => false,
            'request_method' => 'GET',
            'dynamic' => true,
            'hierarchy' => 'all',
        ], $options['filter_choice']);

        $pages = $this->manager->loadPages($options['site']);

        $choices = [];

        foreach ($pages as $page) {
            // internal cannot be selected
            if ($page->isInternal()) {
                continue;
            }

            if (!$filter_choice['current_page'] && $options['page'] && $options['page']->getId() === $page->getId()) {
                continue;
            }

            if (
                'all' !== $filter_choice['hierarchy'] && (
                    ('root' !== $filter_choice['hierarchy'] || $page->getParent()) &&
                    ('children' !== $filter_choice['hierarchy'] || !$page->getParent())
                )
            ) {
                continue;
            }

            if ('all' !== $filter_choice['dynamic'] && (
                    ($filter_choice['dynamic'] && $page->isDynamic()) ||
                    (!$filter_choice['dynamic'] && !$page->isDynamic())
                )
            ) {
                continue;
            }

            if ('all' !== $filter_choice['request_method'] && !$page->hasRequestMethod($filter_choice['request_method'])) {
                continue;
            }

            $choices[$page->getId()] = $page;

            $this->childWalker($page, $options['page'], $choices);
        }

        return $choices;
    }
103617
public function getIdFromOptions(array $options) : string
    {
        $optionsResolver = new OptionsResolver();
        $optionsResolver->setRequired('id');

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

        return $options['id'];
    }
214909
public function getAttributes()
    {
        $attributes = parent::getAttributes();
        
        if ($this->options) {
            $attributes['remote-options'] = Convert::array2json($this->options);
        }
        
        if ($this->remoteValidator) {
            $attributes['remote-validator'] = $this->remoteValidator;
        }
        
        return $attributes;
    }
1286456
function getOptions(array $options = array())
    {
        if (empty($options)) {
            $params = array(1, $this->username, $this->password);
        } else {
            $params = array(1, $this->username, $this->password, $options);
        }

        return $this->sendRequest('wp.getOptions', $params);
    }
1010298
protected function parseOptionCodes(array $options)
    {
        $valid_options = [];
        foreach ($options['option_codes'] as $optionCode) {
            if (!array_key_exists(strtoupper($optionCode), self::getOptionCodes())) {
                $message = sprintf(
                    'Unsupported option code: "%s". Supported options are %s',
                    $optionCode,
                    implode(', ', array_keys(self::getOptionCodes()))
                );
                throw new \InvalidArgumentException($message);
            }
            // @todo Perhaps we should check for conflicts here, might be overkill.
            // From Canada Post docs:
            // There are some options that can be applied to a shipment that
            // conflict with the presence of another option. You can use the
            // "Get Option" call in advance to check the contents of the
            // <conflicting-options> group from a Get Option call for options
            // selected by end users or options available for a given service.
            $valid_options[] = [
                'option-code' => $optionCode,
            ];
        }

        return $valid_options;
    }
612143
protected function getOptions(array  $options): array
    {
        $options['format'] = array_get($options, 'format', $this->format);
        $options['locale'] = array_get($options, 'locale', config('app.locale'));

        return $options;
    }
1368013
public function toArray(array $options = [])
    {
        $childrenIds = [];

        /** @var NodeInterface $child */
        foreach ($this->getChildren() as $child) {
            $childrenIds[] = $child->getId();
        }

        return [
            'id'                => $this->getId(),
            'name'              => $this->getName(),
            'type'              => $this->getType(),
            'metadata'          => $this->getMetadata()->getData(),
            'parentId'          => $this->getParent() ?
                $this->getParent()->getId() :
                null,
            'childrenIds'       => $childrenIds
        ];
    }
968524
public function getResults(array $options = []) : array
    {
        $this->_instance = $this->getReportInstance($options);
        if (null === $this->_instance) {
            return [];
        }

        $config = $this->getReport($options);
        if (empty($config)) {
            return [];
        }

        $this->setConfig($config);
        $this->setContainerId($config);

        $validated = $this->validate($config);

        if (! $validated['status']) {
            throw new RuntimeException("Report validation failed");
        }

        $result = $this->getQueryData($config);

        if (!empty($result)) {
            $this->_instance->getChartData($result);
            $this->setOptions(['scripts' => $this->_instance->getScripts()]);
        }

        return $result;
    }
1164062
public function fromArray(array $options)
    {
        if (isset($options['Id'])) {
            Validate::isString($options['Id'], 'options[Id]');
            $this->_id = $options['Id'];
        }

        if (isset($options['Name'])) {
            Validate::isString($options['Name'], 'options[Name]');
            $this->_name = $options['Name'];
        }

        if (isset($options['ContentFileSize'])) {
            Validate::isString(
                $options['ContentFileSize'],
                'options[ContentFileSize]'
            );
            $this->_contentFileSize = $options['ContentFileSize'];
        }

        if (isset($options['ParentAssetId'])) {
            Validate::isString(
                $options['ParentAssetId'],
                'options[ParentAssetId]'
            );
            $this->_parentAssetId = $options['ParentAssetId'];
        }

        if (isset($options['EncryptionVersion'])) {
            Validate::isString(
                $options['EncryptionVersion'],
                'options[EncryptionVersion]'
            );
            $this->_encryptionVersion = $options['EncryptionVersion'];
        }

        if (isset($options['EncryptionScheme'])) {
            Validate::isString(
                $options['EncryptionScheme'],
                'options[EncryptionScheme]'
            );
            $this->_encryptionScheme = $options['EncryptionScheme'];
        }

        if (isset($options['IsEncrypted'])) {
            Validate::isBoolean(
                $options['IsEncrypted'],
                'options[IsEncrypted]'
            );
            $this->_isEncrypted = $options['IsEncrypted'];
        }

        if (isset($options['EncryptionKeyId'])) {
            Validate::isString(
                $options['EncryptionKeyId'],
                'options[EncryptionKeyId]'
            );
            $this->_encryptionKeyId = $options['EncryptionKeyId'];
        }

        if (isset($options['InitializationVector'])) {
            Validate::isString(
                $options['InitializationVector'],
                'options[InitializationVector]'
            );
            $this->_initializationVector = $options['InitializationVector'];
        }

        if (isset($options['IsPrimary'])) {
            Validate::isBoolean($options['IsPrimary'], 'options[IsPrimary]');
            $this->_isPrimary = $options['IsPrimary'];
        }

        if (isset($options['LastModified'])) {
            Validate::isDateString(
                $options['LastModified'],
                'options[LastModified]'
            );
            $this->_lastModified = new \DateTime($options['LastModified']);
        }

        if (isset($options['Created'])) {
            Validate::isDateString($options['Created'], 'options[Created]');
            $this->_created = new \DateTime($options['Created']);
        }

        if (isset($options['MimeType'])) {
            Validate::isString($options['MimeType'], 'options[MimeType]');
            $this->_mimeType = $options['MimeType'];
        }

        if (isset($options['ContentChecksum'])) {
            Validate::isString(
                $options['ContentChecksum'],
                'options[ContentChecksum]'
            );
            $this->_contentCheckSum = $options['ContentChecksum'];
        }
    }
1125640
protected function getOptions(array $options)
    {
        $labels = [];
        if ($this->hasLanguages()) {
            // As this point we are construction the options for multiple languages
            foreach ($this->languages as $language) {
                foreach ($options as $key => $option) {
                    $labels[$language][$key] = Helpers::convertNameToLabel($option);
                }
            }
        } else {

            // At this point we are just formatting the labels
            foreach ($options as $key => $option) {
                $labels[$key] = Helpers::convertNameToLabel($option);
            }
        }

        return $labels;
    }
695486
protected function validateOptions(array $options)
    {
        $validated = [];

        foreach ($options as $name => $option) {
            if (! in_array($name, $this->getAllowedOptions())) {
                throw new DomainException('The "'.$name.'" option is not allowed on the provided form.');
            }

            $validated[$name] = $option;
        }

        return $validated;
    }
392839
protected function parseOptions(array $options)
    {
        $options = array_merge($this->defaultOptions, $options);

        foreach ($options as $option => $value) {
            if (! in_array($option, $this->allowedOptions, true)) {
                throw new \InvalidArgumentException("Option [$option] is not allowed.");
            }
        }

        return $options;
    }
1341975
public function validate(array $options = array()) {
        $validated= false;
        if ($validator= $this->getValidator()) {
            $validated= $this->_validator->validate($options);
            if ($this->xpdo->getDebug() === true) {
                $this->xpdo->log(xPDO::LOG_LEVEL_DEBUG, "Validator class executed, result = " . print_r($validated, true));
            }
        } else {
            if ($this->xpdo->getDebug() === true) {
                $this->xpdo->log(xPDO::LOG_LEVEL_DEBUG, "No validator found for {$this->_class} instance.");
            }
            $validated= true;
        }
        return $validated;
    }
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;
	}
1071404
public function options(array $options = null)
    {
        if (null === $options) {
            return $this->options;
        }

        $this->options = [];
        foreach($options as $option)
            $this->options[$option] = false;

        return $this;
    }