This commit is contained in:
2023-11-03 17:44:38 +08:00
parent 115d228158
commit 1582c0c241
4 changed files with 38 additions and 7 deletions
+8 -1
View File
@@ -2,12 +2,19 @@
namespace Kiri\Router\Format;
use Kiri\Di\Inject\Container;
use Kiri\Router\Constrict\Stream;
use Psr\Http\Message\ResponseInterface;
class OtherFormat implements IFormat
{
/**
* @var ResponseInterface
*/
#[Container(ResponseInterface::class)]
public ResponseInterface $response;
/**
* @param mixed $result
@@ -15,7 +22,7 @@ class OtherFormat implements IFormat
*/
public function call(mixed $result): ResponseInterface
{
return \response()->withBody(new Stream($result));
return $this->response->withBody(new Stream($result));
}