0 follower

Interface Yiisoft\DataResponse\DataResponseFactoryInterface

Implemented byYiisoft\DataResponse\DataResponseFactory

DataResponseFactoryInterface is the interface that should be implemented by data response factory classes.

Public Methods

Hide inherited methods

Method Description Defined By
createResponse() Creates an instance of the data response. Yiisoft\DataResponse\DataResponseFactoryInterface

Method Details

Hide inherited methods

createResponse() public abstract method

Creates an instance of the data response.

public abstract Yiisoft\DataResponse\DataResponse createResponse ( mixed $data null, integer $code Status::OK, string $reasonPhrase '' )
$data mixed

The response data.

$code integer

The response status code.

$reasonPhrase string

The response reason phrase associated with the status code.

return Yiisoft\DataResponse\DataResponse

The instance of the data response.

                public function createResponse($data = null, int $code = Status::OK, string $reasonPhrase = ''): DataResponse;