Files
kiri-router/src/Format/ArrayFormat.php
T

23 lines
416 B
PHP
Raw Normal View History

2023-10-17 14:50:46 +08:00
<?php
namespace Kiri\Router\Format;
use Kiri\Router\Constrict\Stream;
use Psr\Http\Message\ResponseInterface;
class ArrayFormat implements IFormat
{
/**
* @param $result
* @return ResponseInterface
*/
public function call($result): ResponseInterface
{
2023-10-17 17:01:18 +08:00
$result = json_encode($result, JSON_UNESCAPED_UNICODE);
return \response()->withBody(new Stream($result));
2023-10-17 14:50:46 +08:00
}
}