This commit is contained in:
2024-12-16 16:29:35 +08:00
parent daa02a6408
commit dc561cec9b
7 changed files with 89 additions and 49 deletions
+7 -2
View File
@@ -9,13 +9,18 @@ use Psr\Http\Message\ResponseInterface;
class OtherFormat implements IFormat
{
/**
public function __construct(public ResponseInterface $response)
{
}
/**
* @param mixed $result
* @return ResponseInterface
*/
public function call(mixed $result): ResponseInterface
{
return di(ResponseInterface::class)->withBody(new Stream($result));
return $this->response->withBody(new Stream($result));
}