public function __construct($url = null) { $this->caseSensitive = false; $this->encoded = true; $this->components = ['scheme' => Request::secure() ? 'https' : 'http', 'host' => null, 'port' => null, 'user' => null, 'pass' => null, 'path' => '', 'query' => [], 'fragment' => null]; if (!is_null($url)) { $this->components = array_merge($this->components, parse_url($url)); $this->components['query'] = $this->sanitizeQuery($this->components['query']); $this->components['path'] = $this->sanitizePath($this->components['path']); $this->components['host'] = $this->sanitizeHost($this->components['host']); } }