src/Domain/Value/Identifier/Uri.php
protected static function normalizeQuery(?string $query): ?string
    {
        if ($query === null) {
            return null;
        }

        if (!static::isValidQuery($query)) {
            $message = sprintf('Invalid URI query: %s', $query);
            throw new DomainException($message);
        }

        return static::encodeQuery(static::decode($query, static::UNRESERVED_SET));
    }
protected static function normalizeQuery(?string $query): ?string
    {
        if ($query === null) {
            return null;
        }

        if (!static::isValidQuery($query)) {
            $message = sprintf('Invalid URI query: %s', $query);
            throw new DomainException($message);
        }

        return static::encodeQuery(static::decode($query, static::UNRESERVED_SET));
    }
protected static function normalizeQuery ( ? string $ query ) : ? string { if ( $ query === null ) { return null ; } if ( ! static :: isValidQuery ( $ query ) ) { $ message = sprintf ( 'Invalid URI query: %s' , $ query ) ; throw new DomainException ( $ message ) ; } return static :: encodeQuery ( static :: decode ( $ query , static :: UNRESERVED_SET ) ) ; }
Validates and normalizes the query

@param string|null $query The query

@return string|null

@throws DomainException When the query is invalid
Validates and normalizes the query