src/Uri.php
/**
     * Parse a URI into its parts, and set the properties
     */
Parse a URI into its parts, and set the properties
Parse a URI into its parts and set the properties
private function parseUri(string $uri) : void
    {
        $parts = parse_url($uri);
        if (false === $parts) {
            throw new Exception\InvalidArgumentException(
                'The source URI string appears to be malformed'
            );
        }
        $this->scheme    = isset($parts['scheme']) ? $this->filterScheme($parts['scheme']) : '';
        $this->userInfo  = isset($parts['user']) ? $this->filterUserInfoPart($parts['user']) : '';
        $this->host      = isset($parts['host']) ? strtolower($parts['host']) : '';
        $this->port      = $parts['port'] ?? null;
        $this->path      = isset($parts['path']) ? $this->filterPath($parts['path']) : '';
        $this->query     = isset($parts['query']) ? $this->filterQuery($parts['query']) : '';
        $this->fragment  = isset($parts['fragment']) ? $this->filterFragment($parts['fragment']) : '';
        if (isset($parts['pass'])) {
            $this->userInfo .= ':' . $parts['pass'];
        }
    }
private function parseUri ( string $ uri ) : void { $ parts = parse_url ( $ uri ) ; if ( false === $ parts ) { throw new Exception \ InvalidArgumentException ( 'The source URI string appears to be malformed' ) ; } $ this -> scheme = isset ( $ parts [ 'scheme' ] ) ? $ this -> filterScheme ( $ parts [ 'scheme' ] ) : '' ; $ this -> userInfo = isset ( $ parts [ 'user' ] ) ? $ this -> filterUserInfoPart ( $ parts [ 'user' ] ) : '' ; $ this -> host = isset ( $ parts [ 'host' ] ) ? strtolower ( $ parts [ 'host' ] ) : '' ; $ this -> port = $ parts [ 'port' ] ?? null ; $ this -> path = isset ( $ parts [ 'path' ] ) ? $ this -> filterPath ( $ parts [ 'path' ] ) : '' ; $ this -> query = isset ( $ parts [ 'query' ] ) ? $ this -> filterQuery ( $ parts [ 'query' ] ) : '' ; $ this -> fragment = isset ( $ parts [ 'fragment' ] ) ? $ this -> filterFragment ( $ parts [ 'fragment' ] ) : '' ; if ( isset ( $ parts [ 'pass' ] ) ) { $ this -> userInfo .= ':' . $ parts [ 'pass' ] ; } }
Parse a URI into its parts, and set the properties
Parse a URI into its parts and set the properties