Kleine Code-Verbesserungen.

This commit is contained in:
2021-04-06 21:33:33 +02:00
parent 520db45d6d
commit a6675605e4
2 changed files with 10 additions and 3 deletions
+9 -2
View File
@@ -1,9 +1,10 @@
<?php
<?php /** @noinspection PhpUndefinedClassInspection */
namespace TorstenHettstedt\TimekeepingApi\Middleware;
use JetBrains\PhpStorm\ArrayShape;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Log\LoggerInterface;
@@ -30,7 +31,13 @@ class ErrorHandler
*
* @return mixed[]
*/
protected function buildJsonArray(Throwable $exception): array
#[ArrayShape([
'timestamp' => "false|string",
'status' => "int",
"error" => "string",
'message' => "string",
'path' => "string"
])] protected function buildJsonArray(Throwable $exception): array
{
$payload = [
'timestamp' => date('Y-m-d\TH:m:sP'),