PHP Класс Flugg\Responder\Responder

Автор: Alexander Tømmerås ([email protected])
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$errorResponse Flugg\Responder\Http\ErrorResponseBuilder The response builder used to build error responses.
$successResponse Flugg\Responder\Http\SuccessResponseBuilder The response builder used to build success responses.

Открытые методы

Метод Описание
__construct ( SuccessResponseBuilder $successResponse, ErrorResponseBuilder $errorResponse ) Constructor.
error ( string $errorCode = null, integer $statusCode = null, mixed $message = null ) : Illuminate\Http\JsonResponse Generate an error JSON response.
success ( mixed | null $data = null, integer | null $statusCode = null, array $meta = [] ) : Illuminate\Http\JsonResponse Generate a successful JSON response.
transform ( mixed | null $data = null, callable | string | null $transformer = null ) : SuccessResponseBuilder Transform the data and return a success response builder.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( SuccessResponseBuilder $successResponse, ErrorResponseBuilder $errorResponse )
$successResponse Flugg\Responder\Http\SuccessResponseBuilder
$errorResponse Flugg\Responder\Http\ErrorResponseBuilder

error() публичный Метод

Generate an error JSON response.
public error ( string $errorCode = null, integer $statusCode = null, mixed $message = null ) : Illuminate\Http\JsonResponse
$errorCode string
$statusCode integer
$message mixed
Результат Illuminate\Http\JsonResponse

success() публичный Метод

Generate a successful JSON response.
public success ( mixed | null $data = null, integer | null $statusCode = null, array $meta = [] ) : Illuminate\Http\JsonResponse
$data mixed | null
$statusCode integer | null
$meta array
Результат Illuminate\Http\JsonResponse

transform() публичный Метод

Transform the data and return a success response builder.
public transform ( mixed | null $data = null, callable | string | null $transformer = null ) : SuccessResponseBuilder
$data mixed | null
$transformer callable | string | null
Результат Flugg\Responder\Http\SuccessResponseBuilder

Описание свойств

$errorResponse защищенное свойство

The response builder used to build error responses.
protected ErrorResponseBuilder,Flugg\Responder\Http $errorResponse
Результат Flugg\Responder\Http\ErrorResponseBuilder

$successResponse защищенное свойство

The response builder used to build success responses.
protected SuccessResponseBuilder,Flugg\Responder\Http $successResponse
Результат Flugg\Responder\Http\SuccessResponseBuilder