public static function redirect($url, array $parameters = [], int $statusCode = Response::STATUS_MOVED_PERMANENTLY) : Response
    {
        if (!empty($parameters)) {
            $url = $url . '?' . http_build_query($parameters);
        }

        $headers = new Headers();
        $headers->add(new Header('Location', $url));

        return new Response('', $statusCode, $headers);
    }
public static function redirect($url, array $parameters = [], int $statusCode = Response::STATUS_MOVED_PERMANENTLY) : Response
    {
        if (!empty($parameters)) {
            $url = $url . '?' . http_build_query($parameters);
        }

        $headers = new Headers();
        $headers->add(new Header('Location', $url));

        return new Response('', $statusCode, $headers);
    }
public static function redirect ( $ url , array $ parameters = [ ] , int $ statusCode = Response :: STATUS_MOVED_PERMANENTLY ) : Response { if ( ! empty ( $ parameters ) ) { $ url = $ url . '?' . http_build_query ( $ parameters ) ; } $ headers = new Headers ( ) ; $ headers -> add ( new Header ( 'Location' , $ url ) ) ; return new Response ( '' , $ statusCode , $ headers ) ; }
Redirect to a url

@param string $url
@param string[] $parameters
@param int $statusCode

@return Response
Redirect to a url