public function setPath(string $path = null)
    {
        if ($path === null) {
            $uri = $this->server->get('REQUEST_URI');

            if (empty($uri)) {
                // Default to a slash
                $this->path = '/';
            } else {
                $uriParts = explode('?', $uri);
                $this->path = $uriParts[0];
            }
        } else {
            $this->path = $path;
        }
    }
public function setPath(string $path = null)
    {
        if ($path === null) {
            $uri = $this->server->get('REQUEST_URI');

            if (empty($uri)) {
                // Default to a slash
                $this->path = '/';
            } else {
                $uriParts = explode('?', $uri);
                $this->path = $uriParts[0];
            }
        } else {
            $this->path = $path;
        }
    }
public function setPath ( string $ path = null ) { if ( $ path === null ) { $ uri = $ this -> server -> get ( 'REQUEST_URI' ) ; if ( empty ( $ uri ) ) { // Default to a slash $ this -> path = '/' ; } else { $ uriParts = explode ( '?' , $ uri ) ; $ this -> path = $ uriParts [ 0 ] ; } } else { $ this -> path = $ path ; } }
Sets the path of this request, which does not include the query string
If no input is specified, then it is automatically set using headers

@param string|null $path The path to set, otherwise null to automatically set the path
Sets the path of this request which does not include the query string If no input is specified then it is automatically set using headers