src/Uri.php
public function parseURI(string $uri) : array
    {
        if ($uri == '') {
            throw new \InvalidArgumentException(
                "URI Could not be empty"
            );
        }

        $parsedUri = parse_url($uri);
        if ($parsedUri === false) {
            throw new \InvalidArgumentException("Unable to parse URI: $uri");
        }

        $defaultParsedUri = [
            'user'  => null,
            'pass'  => null,
            'scheme'=> '',
            'host'  => '',
            'port'  => null,
            'path'  => '',
            'query' => '',
            'fragment' => '',
        ];

        return array_merge($defaultParsedUri, $parsedUri);
    }
public function parseURI(string $uri) : array
    {
        if ($uri == '') {
            throw new \InvalidArgumentException(
                "URI Could not be empty"
            );
        }

        $parsedUri = parse_url($uri);
        if ($parsedUri === false) {
            throw new \InvalidArgumentException("Unable to parse URI: $uri");
        }

        $defaultParsedUri = [
            'user'  => null,
            'pass'  => null,
            'scheme'=> '',
            'host'  => '',
            'port'  => null,
            'path'  => '',
            'query' => '',
            'fragment' => '',
        ];

        return array_merge($defaultParsedUri, $parsedUri);
    }
public function parseURI ( string $ uri ) : array { if ( $ uri == '' ) { throw new \ InvalidArgumentException ( "URI Could not be empty" ) ; } $ parsedUri = parse_url ( $ uri ) ; if ( $ parsedUri === false ) { throw new \ InvalidArgumentException ( "Unable to parse URI: $uri" ) ; } $ defaultParsedUri = [ 'user' => null , 'pass' => null , 'scheme' => '' , 'host' => '' , 'port' => null , 'path' => '' , 'query' => '' , 'fragment' => '' , ] ; return array_merge ( $ defaultParsedUri , $ parsedUri ) ; }
Parse URI and return full detail

@param string $uri

@return array
Parse URI and return full detail