|
@@ -99,7 +99,7 @@ discard block |
|
|
block discarded – undo |
|
99
|
99
|
* |
|
100
|
100
|
* @return ResponseInterface |
|
101
|
101
|
*/ |
|
102
|
|
- public function response(string|array|object $content = '', int $code = StatusCodeInterface::STATUS_OK, array $headers = []): ResponseInterface |
|
|
102
|
+ public function response(string | array | object $content = '', int $code = StatusCodeInterface::STATUS_OK, array $headers = []): ResponseInterface |
|
103
|
103
|
{ |
|
104
|
104
|
if ($content === '' && $code === StatusCodeInterface::STATUS_OK) { |
|
105
|
105
|
$code = StatusCodeInterface::STATUS_NO_CONTENT; |
|
@@ -108,7 +108,7 @@ discard block |
|
|
block discarded – undo |
|
108
|
108
|
if (is_string($content)) { |
|
109
|
109
|
$headers['content-type'] ??= 'text/html; charset=UTF-8'; |
|
110
|
110
|
} else { |
|
111
|
|
- $content = json_encode($content, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE); |
|
|
111
|
+ $content = json_encode($content, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE); |
|
112
|
112
|
$headers['content-type'] ??= 'application/json'; |
|
113
|
113
|
} |
|
114
|
114
|
|
Please login to merge, or discard this patch.