src/Middleware/UnauthorizedHandler/RedirectHandler.php
protected function getUrl(ServerRequestInterface $request, array $options)
    {
        $url = $options['url'];
        if ($options['queryParam'] !== null && $request->getMethod() === 'GET') {
            $query = urlencode($options['queryParam']) . '=' . urlencode($request->getRequestTarget());
            if (strpos($url, '?') !== false) {
                $query = '&' . $query;
            } else {
                $query = '?' . $query;
            }

            $url .= $query;
        }

        return $url;
    }
protected function getUrl(ServerRequestInterface $request, array $options)
    {
        $url = $options['url'];
        if ($options['queryParam'] !== null && $request->getMethod() === 'GET') {
            $query = urlencode($options['queryParam']) . '=' . urlencode($request->getRequestTarget());
            if (strpos($url, '?') !== false) {
                $query = '&' . $query;
            } else {
                $query = '?' . $query;
            }

            $url .= $query;
        }

        return $url;
    }
protected function getUrl ( ServerRequestInterface $ request , array $ options ) { $ url = $ options [ 'url' ] ; if ( $ options [ 'queryParam' ] !== null && $ request -> getMethod ( ) === 'GET' ) { $ query = urlencode ( $ options [ 'queryParam' ] ) . '=' . urlencode ( $ request -> getRequestTarget ( ) ) ; if ( strpos ( $ url , '?' ) !== false ) { $ query = '&' . $ query ; } else { $ query = '?' . $ query ; } $ url .= $ query ; } return $ url ; }
Returns the url for the Location header.

@param \Psr\Http\Message\ServerRequestInterface $request Server request.
@param array $options Options.
@return string
Returns the url for the Location header .