From eeb2251cbcdfbd57e1536b03963bb53811259d44 Mon Sep 17 00:00:00 2001 From: Beutlin Date: Wed, 12 Apr 2023 00:05:56 +0200 Subject: [PATCH] fix types --- application/api/controllers/ApiController.php | 4 ++-- .../front/controller/visitor/ShaarliVisitorController.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/application/api/controllers/ApiController.php b/application/api/controllers/ApiController.php index 1d81f49e5..645325fa6 100644 --- a/application/api/controllers/ApiController.php +++ b/application/api/controllers/ApiController.php @@ -77,10 +77,10 @@ public function getCi() * * @param Response $response * @param array $data - * @param int $jsonStyle + * @param ?int $jsonStyle * @return Response */ - protected function respondWithJson(Response $response, array $data, int $jsonStyle): Response + protected function respondWithJson(Response $response, array $data, ?int $jsonStyle): Response { $jsonStyle = $jsonStyle ?? 0; $response->getBody()->write(json_encode($data, $jsonStyle)); diff --git a/application/front/controller/visitor/ShaarliVisitorController.php b/application/front/controller/visitor/ShaarliVisitorController.php index 142ee5903..2c91cc3d0 100644 --- a/application/front/controller/visitor/ShaarliVisitorController.php +++ b/application/front/controller/visitor/ShaarliVisitorController.php @@ -194,10 +194,10 @@ protected function redirectFromReferer( * * @param Response $response * @param array $data - * @param int $jsonStyle + * @param ?int $jsonStyle * @return Response */ - protected function respondWithJson(Response $response, array $data, int $jsonStyle = 0): Response + protected function respondWithJson(Response $response, array $data, ?int $jsonStyle = 0): Response { $response->getBody()->write(json_encode($data, $jsonStyle)); return $response->withHeader('Content-Type', 'application/json');