Redis service

This commit is contained in:
2023-10-19 20:46:52 -03:00
parent 742c0327c2
commit dc217d876a
10 changed files with 228 additions and 97 deletions

View File

@ -5,7 +5,7 @@ use Psr\Http\Message\ResponseInterface;
trait withJson
{
public function withJson(ResponseInterface $response, array $data = []): ResponseInterface
public function withJson(ResponseInterface $response, array|object $data = []): ResponseInterface
{
$response->getBody()->write(json_encode($data));
return $response->withHeader('Content-Type', 'application/json');