Typehint response

This commit is contained in:
Toby Zerner 2021-01-15 08:38:00 +10:30
parent f53a07c143
commit 813e779e1c
1 changed files with 1 additions and 1 deletions

View File

@ -17,7 +17,7 @@ use Nyholm\Psr7\Response;
use Nyholm\Psr7\Stream; use Nyholm\Psr7\Stream;
use Tobyz\JsonApiServer\Schema\Field; use Tobyz\JsonApiServer\Schema\Field;
function json_api_response(JsonSerializable $document, int $status = 200) function json_api_response(JsonSerializable $document, int $status = 200): Response
{ {
return (new Response($status)) return (new Response($status))
->withHeader('content-type', JsonApi::MEDIA_TYPE) ->withHeader('content-type', JsonApi::MEDIA_TYPE)