public static function createFromString($uri) {

            $parts = parse_url($uri);

            $scheme     = (isset($parts['scheme']) ? $parts['scheme'] : '');

            $user       = new User(
                (isset($parts['user']) ? $parts['user'] : null),
                (isset($parts['pass']) ? $parts['pass'] : null)
            );

            $host       = new Host(isset($parts['host']) ? $parts['host'] : '');
            $port       = intval(isset($parts['port']) ? $parts['port'] : null);
            $path       = new Path(isset($parts['path']) ? $parts['path'] : '');

            if(!empty($parts['query'])) {
                $query  = Query::createFromString($parts['query']);
            }
            else {
                $query  = new Query(array());
            }


            $fragment   = (isset($parts['fragment']) ? $parts['fragment'] : '');

            return new self($scheme, $user, $host, $port, $path, $query, $fragment);

        }