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

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

        return static::encodeFragment(static::decode($fragment, static::UNRESERVED_SET));
    }
protected static function normalizeFragment(?string $fragment): ?string
    {
        if ($fragment === null) {
            return null;
        }

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

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

@param string|null $fragment The fragment

@return string|null

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