src/Url.php
private static function myValidateParts(int $port, UrlPathInterface $urlPath, ?string $queryString, ?string $fragment, ?string &$error): bool
    {
        // Validate port.
        if (!self::myValidatePort($port, $error)) {
            return false;
        }

        // Url path can not be relative.
        if ($urlPath->isRelative()) {
            $error = 'Url path "' . $urlPath . '" is relative.';

            return false;
        }

        // Validate query string.
        if (!self::myValidateQueryString($queryString, $error)) {
            return false;
        }

        // Validate fragment.
        if (!self::myValidateFragment($fragment, $error)) {
            return false;
        }

        return true;
    }
private static function myValidateParts(int $port, UrlPathInterface $urlPath, ?string $queryString, ?string $fragment, ?string &$error): bool
    {
        // Validate port.
        if (!self::myValidatePort($port, $error)) {
            return false;
        }

        // Url path can not be relative.
        if ($urlPath->isRelative()) {
            $error = 'Url path "' . $urlPath . '" is relative.';

            return false;
        }

        // Validate query string.
        if (!self::myValidateQueryString($queryString, $error)) {
            return false;
        }

        // Validate fragment.
        if (!self::myValidateFragment($fragment, $error)) {
            return false;
        }

        return true;
    }
private static function myValidateParts ( int $ port , UrlPathInterface $ urlPath , ? string $ queryString , ? string $ fragment , ? string & $ error ) : bool { // Validate port. if ( ! self :: myValidatePort ( $ port , $ error ) ) { return false ; } // Url path can not be relative. if ( $ urlPath -> isRelative ( ) ) { $ error = 'Url path "' . $ urlPath . '" is relative.' ; return false ; } // Validate query string. if ( ! self :: myValidateQueryString ( $ queryString , $ error ) ) { return false ; } // Validate fragment. if ( ! self :: myValidateFragment ( $ fragment , $ error ) ) { return false ; } return true ; }
Validates parts of url.

@param int              $port        The port.
@param UrlPathInterface $urlPath     The url path.
@param string|null      $queryString The query string or null if no query string should be used.
@param string|null      $fragment    The fragment or null if no fragment should be used.
@param string|null      $error       The error text if validation was not successful, undefined otherwise.

@return bool True if validation was successful, false otherwise.
Validates parts of url .