Port::get( string $type ): int

In this article

Retrieve the port number to use.

Parameters

$typestringrequired
Request type.
The following requests types are supported: 'acap', 'dict', 'http' and 'https'.

Return

int

Source

public static function get($type) {
	if (!is_string($type)) {
		throw InvalidArgument::create(1, '$type', 'string', gettype($type));
	}

	$type = strtoupper($type);
	if (!defined("self::{$type}")) {
		$message = sprintf('Invalid port type (%s) passed', $type);
		throw new Exception($message, 'portnotsupported');
	}

	return constant("self::{$type}");
}

User Contributed Notes

You must log in before being able to contribute a note or feedback.