for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace App\Infrastructure\IO\Http\User\GetView\Response;
use App\Application\User\Entity\User;
use Psr\Http\Message\ResponseInterface;
use Yiisoft\DataResponse\DataResponseFactoryInterface;
final class ResponseFactory
{
public function __construct(
private DataResponseFactoryInterface $responseFactory,
) {
}
public function create(User $user): ResponseInterface
$response = new Response(
$user->getLogin(),
$user->getCreatedAt()->format(\DateTimeImmutable::ATOM)
);
return $this->responseFactory->createResponse([
'user' => $response,
]);