Return an array of valid options for the hosts property.

@return array
429433
protected function get_valid_hosts_options() {
        global $CFG;
        require_once($CFG->dirroot.'/mnet/service/enrol/locallib.php');

        $service = mnetservice_enrol::get_instance();

        $subscribers = $service->get_remote_subscribers();
        $hosts = array(0 => get_string('remotesubscribersall', 'enrol_mnet'));
        foreach ($subscribers as $hostid => $subscriber) {
            $hosts[$hostid] = $subscriber->appname.': '.$subscriber->hostname.' ('.$subscriber->hosturl.')';
        }
        return $hosts;
    }
267436
protected function getOptions() : array
    {
        $options = [];

        foreach ($this->elements as $element) {
            if ($element instanceof Option) {
                $options[] = $element;
            }
            elseif ($element instanceof OptionGroup) {
                $options = array_merge($options, $element->getOptions());
            }
        }

        return $options;
    }
812871
protected function get_blacklisted_hosts() {
        global $CFG;
        if (!isset($CFG->curlsecurityblockedhosts)) {
            return [];
        }
        return array_filter(array_map('trim', explode("\n", $CFG->curlsecurityblockedhosts)), function($entry) {
            return !empty($entry);
        });
    }
453831
public function getHttpOptions()
    {
        $options = array(
            'headers' => $this->getHttpHeaders(),
            'connect_timeout' => $this->timeout,
            'timeout' => $this->timeout,
        );
        if ($this->credentials) {
            $options['auth'] = $this->credentials;
        }
        if ($this->proxy) {
            $options['proxy'] = $this->proxy;
        }
        return $options;
    }
766770
private function getOptions(array $config = []): array
    {
        $resolver = new OptionsResolver();

        $resolver->setDefaults([
            'timeout' => 5,
            'verify_peer' => true,
            'verify_host' => 2,
            'proxy' => null,
        ]);

        $resolver->setAllowedTypes('timeout', 'int');
        $resolver->setAllowedTypes('verify_peer', 'bool');
        $resolver->setAllowedTypes('verify_host', 'int');
        $resolver->setAllowedTypes('proxy', ['string', 'null']);

        return $resolver->resolve($config);
    }
238391
protected function getHosts(): array
    {
        $domains = [];
        foreach ($this->siteFinder->getAllSites() as $site) {
            foreach ($site->getAllLanguages() as $language) {
                $domains[] = $language->getBase()->getHost();
            }
        }
        $domains = array_unique($domains);
        sort($domains, SORT_NATURAL);
        return $domains;
    }
422572
public function getOptions()
  {
    $options = [
      'trace'      => $this->getTrace(),
      'cache_wsdl' => $this->getCache(),
      'classmap'   => $this->getClassmap(),
    ];

    if ($this->certificate) {
      $options['local_cert'] = $this->certificate;
    }

    $this->options = array_merge($options, $this->options);

    return $this->options;
  }
1328192
protected function getBaseOptions()
    {
        $options = [
            'base_uri' => method_exists($this, 'getBaseUri') ? $this->getBaseUri() : '',
            'timeout' => property_exists($this, 'timeout') ? $this->timeout : 5.0,
        ];

        return $options;
    }
736770
public function getAllOptions() {
      $options = array();

      foreach($this->_flags as $option => $index) {
        if(array_key_exists($index, $this->_options)) {
          $options[$option] = $this->_options[$index];
        }
      }

      return $options;
    }
889707
protected function buildOptions(): array
    {
        if (is_string($this->options)) {
            $this->loadRemoteOptions($this->options);
        }

        if ($this->options instanceof \Closure) {
            $this->options = $this->options->call($this->filter, $this->filter->getValue());
        }

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

        if (empty($this->script)) {
            $placeholder = trans('admin.choose');

            $this->script = <<<SCRIPT
$(".{$this->getElementClass()}").select2({
  placeholder: "$placeholder"
});

SCRIPT;
        }

        Admin::script($this->script);

        return is_array($this->options) ? $this->options : [];
    }
870431
public function getOptions()
    {
        return [
            \Dotdigitalgroup\Email\Model\Importer::NOT_IMPORTED => __('Not Imported'),
            \Dotdigitalgroup\Email\Model\Importer::IMPORTING => __('Importing'),
            \Dotdigitalgroup\Email\Model\Importer::IMPORTED => __('Imported'),
            \Dotdigitalgroup\Email\Model\Importer::FAILED => __('Failed'),
        ];
    }
698503
public function settings() {
		$structure = \Application::get('application.structure') ?? [];
		$result = [];
		$host_parts = \Request::hostParts();
		$validator = new \Object\Validator\Domain\Part();
		// see if we are in multi db environment
		if (!empty($structure['db_multiple'])) {
			// validate host part
			$validated = [];
			if (!empty($host_parts[$structure['db_domain_level']])) {
				$validated = $validator->validate($host_parts[$structure['db_domain_level']]);
			}
			if (empty($validated['success'])) {
				if (!empty($structure['db_not_found_url'])) {
					\Request::redirect($structure['db_not_found_url']);
				} else {
					\Object\Error\Base::$flag_database_tenant_not_found = true;
					Throw new \Exception('Invalid URL!', -1);
				}
			}
			// default settings are for default db and cache links
			$result['cache']['default']['cache_key'] = $result['db']['default']['dbname'] = ($structure['db_prefix'] ?? '') . $validated['data'];
		}
		// multi tenant environment
		if (!empty($structure['tenant_multiple'])) {
			// validate host part
			$validated = [];
			if (!empty($host_parts[$structure['tenant_domain_level']])) {
				$validated = $validator->validate($host_parts[$structure['tenant_domain_level']]);
			}
			if (empty($validated['success'])) {
				if (!empty($structure['tenant_not_found_url'])) {
					\Request::redirect($structure['tenant_not_found_url']);
				} else {
					\Object\Error\Base::$flag_database_tenant_not_found = true;
					Throw new \Exception('Invalid URL!', -1);
				}
			}
			// clenup tenant name
			$result['tenant']['code'] = strtoupper($validated['data']);
		} else if (!empty($structure['tenant_default_id'])) { // we simply use id if its a single tenant system
			$result['tenant']['id'] = (int) $structure['tenant_default_id'];
		}
		// put settings back to registry
		\Application::set('application.structure.settings', $result);
		return $result;
	}
728127
public function options()
    {
        $request = new HTTP\Request('OPTIONS', $this->getAbsoluteUrl(''));
        $response = $this->send($request);

        $dav = $response->getHeader('Dav');
        if (!$dav) {
            return [];
        }

        $features = explode(',', $dav);
        foreach ($features as &$v) {
            $v = trim($v);
        }

        return $features;
    }
715338
private function get_options() {
        if (!isset($this->field->param5)) {
            $this->field->param5 = 0;
        }
        $options = array();
        $options['trusttext'] = false;
        $options['forcehttps'] = false;
        $options['subdirs'] = false;
        $options['maxfiles'] = -1;
        $options['context'] = $this->context;
        $options['maxbytes'] = $this->field->param5;
        $options['changeformat'] = 0;
        $options['noclean'] = false;
        return $options;
    }
762055
protected function getOptions()
    {
        return [
            ['host', null, InputOption::VALUE_OPTIONAL, 'The host address to serve the application on.', 'localhost'],

            ['port', null, InputOption::VALUE_OPTIONAL, 'The port to serve the application on.', 8000],

            ['ini', null, InputOption::VALUE_NONE, 'Whether to load custom php.ini'],

            ['ini-path', null, InputOption::VALUE_OPTIONAL, 'Path to custom php.ini file', $this->defaultIniPath],
        ];
    }
1291632
protected function getServerInitConfig()
    {
        return [
            'host'      => isset($this->config['host']) ? $this->config['host'] : '0.0.0.0',
            'port'      => isset($this->config['port']) ? $this->config['port'] : 8080,
            'sockType'  => isset($this->config['sockType']) ? (SWOOLE_SOCK_UDP | $this->config['sockType']) : SWOOLE_SOCK_UDP,
            'mode'      => isset($this->config['mode']) ? $this->config['mode'] : SWOOLE_PROCESS,
        ];
    }
755528
public function addresses()
    {
        if (Validation::ip($this->_config['host'])) {
            return [$this->_config['host']];
        }

        return gethostbynamel($this->_config['host']);
    }