mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
Get rid of deprecated method calls
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
<?php
|
||||
|
||||
use GuzzleHttp\Psr7\Message;
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
use function GuzzleHttp\Psr7\str;
|
||||
|
||||
function respond_json($responseData, int $statusCode = 200)
|
||||
{
|
||||
return str(new Response(
|
||||
return Message::toString(new Response(
|
||||
$statusCode,
|
||||
['Content-Type' => 'application/json'],
|
||||
json_encode($responseData, JSON_INVALID_UTF8_IGNORE)
|
||||
@@ -14,7 +15,7 @@ function respond_json($responseData, int $statusCode = 200)
|
||||
|
||||
function respond_html(string $html, int $statusCode = 200)
|
||||
{
|
||||
return str(new Response(
|
||||
return Message::toString(new Response(
|
||||
$statusCode,
|
||||
['Content-Type' => 'text/html'],
|
||||
$html
|
||||
|
||||
Reference in New Issue
Block a user