private function formatQueryAndFragment(?string $component): ?string
    {
        if (null === $component || '' === $component) {
            return $component;
        }

        static $pattern = '/(?:[^'.self::REGEXP_CHARS_UNRESERVED.self::REGEXP_CHARS_SUBDELIM.'%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/';
        return preg_replace_callback($pattern, [Uri::class, 'urlEncodeMatch'], $component);
    }
private function formatQueryAndFragment(?string $component): ?string
    {
        if (null === $component || '' === $component) {
            return $component;
        }

        static $pattern = '/(?:[^'.self::REGEXP_CHARS_UNRESERVED.self::REGEXP_CHARS_SUBDELIM.'%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/';
        return preg_replace_callback($pattern, [Uri::class, 'urlEncodeMatch'], $component);
    }
private function formatQueryAndFragment ( ? string $ component ) : ? string { if ( null === $ component || '' === $ component ) { return $ component ; } static $ pattern = '/(?:[^' . self :: REGEXP_CHARS_UNRESERVED . self :: REGEXP_CHARS_SUBDELIM . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/' ; return preg_replace_callback ( $ pattern , [ Uri :: class , 'urlEncodeMatch' ] , $ component ) ; }
Format the Query or the Fragment component.

Returns a array containing:
<ul>
<li> the formatted component (a string or null)</li>
<li> a boolean flag telling wether the delimiter is to be added to the component
when building the URI string representation</li>
</ul>

@param ?string $component
Format the Query or the Fragment component .