api-erstellen #1
@@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php /** @noinspection PhpMissingFieldTypeInspection */
|
||||||
|
|
||||||
namespace TorstenHettstedt\TimekeepingApi\Controller;
|
namespace TorstenHettstedt\TimekeepingApi\Controller;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
<?php
|
<?php /** @noinspection PhpUndefinedClassInspection */
|
||||||
|
|
||||||
|
|
||||||
namespace TorstenHettstedt\TimekeepingApi\Middleware;
|
namespace TorstenHettstedt\TimekeepingApi\Middleware;
|
||||||
|
|
||||||
|
|
||||||
|
use JetBrains\PhpStorm\ArrayShape;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
@@ -30,7 +31,13 @@ class ErrorHandler
|
|||||||
*
|
*
|
||||||
* @return mixed[]
|
* @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 = [
|
$payload = [
|
||||||
'timestamp' => date('Y-m-d\TH:m:sP'),
|
'timestamp' => date('Y-m-d\TH:m:sP'),
|
||||||
|
|||||||
Reference in New Issue
Block a user