Embryo/Http/Message/Traits/ResponseTrait.php
public function withRedirect($url, $status = null)
        {
            $response = $this->withHeader('Location', (string)$url);
            if (is_null($status) && $this->getStatusCode() === 200) {
                $status = 302;
            }
            if (!is_null($status)) {
                return $response->withStatus($status);
            }
            return $response;
        }
public function withRedirect($url, $status = null)
        {
            $response = $this->withHeader('Location', (string)$url);
            if (is_null($status) && $this->getStatusCode() === 200) {
                $status = 302;
            }
            if (!is_null($status)) {
                return $response->withStatus($status);
            }
            return $response;
        }
public function withRedirect ( $ url , $ status = null ) { $ response = $ this -> withHeader ( 'Location' , ( string ) $ url ) ; if ( is_null ( $ status ) && $ this -> getStatusCode ( ) === 200 ) { $ status = 302 ; } if ( ! is_null ( $ status ) ) { return $ response -> withStatus ( $ status ) ; } return $ response ; }
Prepares the response object to return an HTTP redirect
response to the client.

@param string|UriInterface $url
@param int|null $status
@return static
Prepares the response object to return an HTTP redirect response to the client .