This commit is contained in:
xl
2023-11-07 14:28:57 +08:00
parent ada5ebfdbd
commit 284d5bdbf9
2 changed files with 16 additions and 10 deletions
+3 -1
View File
@@ -17,13 +17,15 @@ class MixedFormat implements IFormat
public ResponseInterface $response;
/**
* @param mixed $result
* @return ResponseInterface
*/
public function call(mixed $result): ResponseInterface
{
if ($result instanceof ResponseInterface) {
return $result;
}
if (is_object($result)) {
return $this->response->withBody(new Stream('[object]'));
}