src/Message/Response.php
public function withStatus($code, $reasonPhrase = '')
    {
        $response = clone $this;
        $response->setStatus($code, $reasonPhrase);
        return $response;
    }
public function withStatus($code, $reasonPhrase = '')
    {
        $response = clone $this;
        $response->setStatus($code, $reasonPhrase);
        return $response;
    }
Return an instance with the specified status code and, optionally, reason phrase.

@link http://tools.ietf.org/html/rfc7231#section-6
@link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
@param int $code The 3-digit integer result code to set.
@param string $reasonPhrase The reason phrase to use with the
provided status code; if none is provided, implementations MAY
use the defaults as suggested in the HTTP specification.
@return static
@throws \InvalidArgumentException For invalid status code arguments.