ResponseTransformer
in package
implements
ResponseTransformerInterface
Class ResponseTransformer
Tags
Table of Contents
Interfaces
- ResponseTransformerInterface
- Interface ResponseTransformerInterface
Methods
- __construct() : mixed
- ResponseTransformer constructor.
- createCustomResponse() : array<int|string, mixed>
- Transforms PSR-7 response into response array.
- createResponse() : ResponseInterface
- Transforms PSR-7 response into response model.
- getHandler() : HandlerInterface|null
- Returns HandlerInterface.
Methods
__construct()
ResponseTransformer constructor.
public
__construct(HandlerInterface $handler) : mixed
Parameters
- $handler : HandlerInterface
createCustomResponse()
Transforms PSR-7 response into response array.
public
createCustomResponse(string $baseUrl, RequestInterface $request, ResponseInterface $response) : array<int|string, mixed>
You can alter the results by providing your chain of handlers.
Parameters
- $baseUrl : string
- $request : RequestInterface
- $response : ResponseInterface
Tags
Return values
array<int|string, mixed>createResponse()
Transforms PSR-7 response into response model.
public
createResponse(string $baseUrl, RequestInterface $request, ResponseInterface $response, string $type) : ResponseInterface
You can alter the results by providing your chain of handlers.
Parameters
- $baseUrl : string
- $request : RequestInterface
- $response : ResponseInterface
- $type : string
Tags
Return values
ResponseInterfacegetHandler()
Returns HandlerInterface.
public
getHandler() : HandlerInterface|null