Documentation

ResponseCreator
in package

Table of Contents

RESPONSE_ERROR  = 'Request error'
RESPONSE_SUCCESS  = 'Success'
$arrayTransformer  : ArrayTransformerInterface
$data  : mixed
$errors  : array<string|int, Error>
$exceptionTransformer  : ExceptionTransformer
$formErrorsTransformer  : FormErrorsTransformer
$serializer  : SerializerInterface
createError()  : JsonResponse
createSuccess()  : JsonResponse
data()  : mixed
errors()  : array<string|int, mixed>
fromArray()  : mixed
fromException()  : JsonResponse
serializerCreate()  : Serializer
setSerializerContext()  : SerializationContext
toArray()  : array<string|int, mixed>

Constants

Properties

$arrayTransformer

private ArrayTransformerInterface $arrayTransformer

$exceptionTransformer

private ExceptionTransformer $exceptionTransformer

Methods

createError()

public createError(mixed $errors[, int $code = Response::HTTP_OK ]) : JsonResponse
Parameters
$errors : mixed
$code : int = Response::HTTP_OK
Return values
JsonResponse

createSuccess()

public createSuccess([mixed $data = null ][, int $code = Response::HTTP_OK ]) : JsonResponse
Parameters
$data : mixed = null
$code : int = Response::HTTP_OK
Return values
JsonResponse

errors()

public errors() : array<string|int, mixed>
Return values
array<string|int, mixed>

fromArray()

public fromArray(array<string|int, mixed> $data, string $type[, DeserializationContext|null $context = null ]) : mixed
Parameters
$data : array<string|int, mixed>
$type : string
$context : DeserializationContext|null = null
Return values
mixed

fromException()

public fromException(Exception $exception) : JsonResponse
Parameters
$exception : Exception
Return values
JsonResponse

serializerCreate()

public serializerCreate() : Serializer
Return values
Serializer

setSerializerContext()

public setSerializerContext() : SerializationContext
Return values
SerializationContext

toArray()

public toArray(mixed $data[, SerializationContext|null $context = null ][, string|null $type = null ]) : array<string|int, mixed>
Parameters
$data : mixed
$context : SerializationContext|null = null
$type : string|null = null
Return values
array<string|int, mixed>

Search results