src/Url.php
public static function parse($url, $component = null)
    {
        if ($component && isset(self::$mapping[$component]) === false) {
            throw new \Exception("Unknown component: {$component}");
        }

        return \parse_url($url, $component ? self::$mapping[$component] : -1);
    }
public static function parse($url, $component = null)
    {
        if ($component && isset(self::$mapping[$component]) === false) {
            throw new \Exception("Unknown component: {$component}");
        }

        return \parse_url($url, $component ? self::$mapping[$component] : -1);
    }
Almost the same as parse_url, except $component is expected local consts

@param string $url The URL to parse. Invalid characters are replaced by _.
@param int $component Optional. Specify one of
self::SCHEME,
self::HOST,
self::PORT,
self::USER,
self::PASS,
self::PATH,
self::QUERY,
self::FRAGMENT
to retrieve just a specific URL component as a string (except
when self::PORT is given, in which case the return value will be an integer).
@throws \Exception If $component is unknown.
@return array|string|int|bool If the component parameter is omitted,
an associative array is returned. At least one element will be present
within the array. If the component parameter is specified, self::parse()
returns a string (or an integer, in the case of self::PORT) instead of
an array. If the requested component doesn't exist within the given URL,
NULL will be returned.

@deprecated