Interface Yiisoft\DataResponse\ResponseFactory\DataResponseFactoryInterface
Interface for factories that create HTTP responses with Yiisoft\DataResponse\DataStream\DataStream body.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| createResponse() | Creates an HTTP response with the given data wrapped in a Yiisoft\DataResponse\DataStream\DataStream. | Yiisoft\DataResponse\ResponseFactory\DataResponseFactoryInterface |
Method Details
Creates an HTTP response with the given data wrapped in a Yiisoft\DataResponse\DataStream\DataStream.
| public abstract createResponse( mixed $data = null, integer $code = Status::OK, string $reasonPhrase = '' ): \Psr\Http\Message\ResponseInterface | ||
| $data | mixed |
The data to include in the response body. |
| $code | integer |
The HTTP status code. |
| $reasonPhrase | string |
The reason phrase. If empty, a default phrase for the status code will be used. |
| return | \Psr\Http\Message\ResponseInterface |
The created response with Yiisoft\DataResponse\DataStream\DataStream body. |
|---|---|---|
public function createResponse(
mixed $data = null,
int $code = Status::OK,
string $reasonPhrase = '',
): ResponseInterface;
Signup or Login in order to comment.