From b094cf818013f8796f5ab54b4505ec75083d40fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20L=C3=BCcke?= Date: Thu, 1 May 2025 17:53:02 +0200 Subject: [PATCH] Kleine Korrekturen wegen PHP 8.1 --- api/src/Controller/HttpConflictRequestException.php | 9 ++------- api/tests/unit/Controller/WorkingHoursControllerTest.php | 1 + .../unit/Controller/WorkingHoursViewControllerTest.php | 1 + api/tests/unit/Middleware/ErrorHandlerTest.php | 1 + 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/api/src/Controller/HttpConflictRequestException.php b/api/src/Controller/HttpConflictRequestException.php index f995249..8315fe4 100644 --- a/api/src/Controller/HttpConflictRequestException.php +++ b/api/src/Controller/HttpConflictRequestException.php @@ -8,13 +8,8 @@ class HttpConflictRequestException extends HttpSpecializedException { /** @var int */ protected $code = 409; - /** @var string */ protected $message = 'Conflict.'; - - /** @var string */ - protected $title = '409 Conflict'; - - /** @var string */ - protected $description = 'The 409 (Conflict) status code indicates that the request could not be completed due to a conflict with the current state of the target resource.'; + protected string $title = '409 Conflict'; + protected string $description = 'The 409 (Conflict) status code indicates that the request could not be completed due to a conflict with the current state of the target resource.'; } diff --git a/api/tests/unit/Controller/WorkingHoursControllerTest.php b/api/tests/unit/Controller/WorkingHoursControllerTest.php index 40d67e3..a44846d 100644 --- a/api/tests/unit/Controller/WorkingHoursControllerTest.php +++ b/api/tests/unit/Controller/WorkingHoursControllerTest.php @@ -51,6 +51,7 @@ class WorkingHoursControllerTest extends Unit 'write' => function (mixed $data) { $this->assertIsString($data); $this->assertJson($data); + return strlen($data); }, ]), 'withHeader' => $this->makeEmpty(Response::class, [ diff --git a/api/tests/unit/Controller/WorkingHoursViewControllerTest.php b/api/tests/unit/Controller/WorkingHoursViewControllerTest.php index fa2ca2f..e7c4768 100644 --- a/api/tests/unit/Controller/WorkingHoursViewControllerTest.php +++ b/api/tests/unit/Controller/WorkingHoursViewControllerTest.php @@ -35,6 +35,7 @@ class WorkingHoursViewControllerTest extends Unit 'write' => function (mixed $data) { $this->assertIsString($data); $this->assertJson($data); + return strlen($data); }, ]), 'withHeader' => $this->makeEmpty(Response::class, [ diff --git a/api/tests/unit/Middleware/ErrorHandlerTest.php b/api/tests/unit/Middleware/ErrorHandlerTest.php index 036fd8b..e317c0a 100644 --- a/api/tests/unit/Middleware/ErrorHandlerTest.php +++ b/api/tests/unit/Middleware/ErrorHandlerTest.php @@ -38,6 +38,7 @@ class ErrorHandlerTest extends Unit 'write' => function (mixed $data) { $this->assertIsString($data); $this->assertJson($data); + return strlen($data); }, ]), ]),