Skip to content

Commit

Permalink
Add streamed response constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Kolb committed Nov 19, 2021
1 parent cbcaf99 commit 91be507
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/ResponseConstructor/StreamedResponseConstructor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace DigitalCraftsman\CQRS\ResponseConstructor;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;

final class StreamedResponseConstructor implements ResponseConstructorInterface
{
/** @param callable $data */
public function constructResponse($data, Request $request): Response
{
return new StreamedResponse($data);
}
}

0 comments on commit 91be507

Please sign in to comment.