Create a new URL from URL parts
string $scheme Scheme of the URL:
string $host Host of the URL:
string $username Username of the URL:
string $password Password of the URL:
int $port Port of the URL:
string $path Path of the URL:
QueryString|array|string $query Query string of the URL:
string $fragment Fragment of the URL:
public function __construct($scheme, $host, $username = null, $password = null, $port = null, $path = null, QueryString $query = null, $fragment = null) {
$this->scheme = $scheme;
$this->host = $host;
$this->port = $port;
$this->username = $username;
$this->password = $password;
$this->fragment = $fragment;
$this
->setQuery($query ?: new QueryString());
if ($path) {
$this
->setPath($path);
}
}