AbstractResponseHandler
extends AbstractHandler
in package
implements
SerializerAwareInterface, EventDispatcherAwareInterface, ApiExceptionFactoryAwareInterface
Uses
SerializerAwareTrait, EventDispatcherAwareTrait, ApiExceptionFactoryAwareTrait
AbstractYes
Class AbstractResponseHandler
Tags
Table of Contents
Interfaces
- SerializerAwareInterface
- Interface SerializerAwareInterface
- EventDispatcherAwareInterface
- Interface EventDispatcherAwareInterface
- ApiExceptionFactoryAwareInterface
- Interface ApiExceptionFactoryAwareInterface
Methods
- __construct() : mixed
- ResponseTransformer constructor.
- append() : HandlerInterface
- Appends handler to the end of the chain. Returns handler which was used.
- getLastHandler() : HandlerInterface
- Returns last handler in the chain. Returns current handler if this chain consist of only this handler.
- getNext() : HandlerInterface|null
- Returns next handler or null if it's not present.
- getSerializer() : SerializerInterface
- handle() : mixed
- Handle some generic item.
- setApiExceptionFactory() : self
- setEventDispatcher() : object
- Sets PSR-14 compatible event dispatcher. Useful if you want to handle specific errors in one place.
- setNext() : HandlerInterface
- Sets next handler in the chain.
- setSerializer() : self
Methods
__construct()
ResponseTransformer constructor.
public
__construct(SerializerInterface $serializer, ApiExceptionFactory $exceptionFactory[, EventDispatcherInterface|null $eventDispatcher = null ]) : mixed
Parameters
- $serializer : SerializerInterface
- $exceptionFactory : ApiExceptionFactory
- $eventDispatcher : EventDispatcherInterface|null = null
append()
Appends handler to the end of the chain. Returns handler which was used.
public
append(HandlerInterface $handler) : HandlerInterface
Parameters
- $handler : HandlerInterface
Tags
Return values
HandlerInterfacegetLastHandler()
Returns last handler in the chain. Returns current handler if this chain consist of only this handler.
public
getLastHandler() : HandlerInterface
Tags
Return values
HandlerInterfacegetNext()
Returns next handler or null if it's not present.
public
getNext() : HandlerInterface|null
Tags
Return values
HandlerInterface|nullgetSerializer()
public
getSerializer() : SerializerInterface
Return values
SerializerInterfacehandle()
Handle some generic item.
public
final handle(mixed $item) : mixed
Parameters
- $item : mixed
Tags
setApiExceptionFactory()
public
setApiExceptionFactory(ApiExceptionFactory $apiExceptionFactory) : self
Parameters
- $apiExceptionFactory : ApiExceptionFactory
Return values
selfsetEventDispatcher()
Sets PSR-14 compatible event dispatcher. Useful if you want to handle specific errors in one place.
public
setEventDispatcher(EventDispatcherInterface|null $eventDispatcher) : object
Parameters
- $eventDispatcher : EventDispatcherInterface|null
Return values
objectsetNext()
Sets next handler in the chain.
public
setNext(HandlerInterface $handler) : HandlerInterface
Parameters
- $handler : HandlerInterface
Tags
Return values
HandlerInterfacesetSerializer()
public
setSerializer(SerializerInterface $serializer) : self
Parameters
- $serializer : SerializerInterface