From fdf4cef535ce9f11a40ff09085dc04022b0b1662 Mon Sep 17 00:00:00 2001 From: Marius Karstedt Date: Tue, 5 Mar 2024 15:20:35 +0100 Subject: [PATCH] fixed array to string conversion --- .../Http/Input/Exceptions/InputValidationException.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Pecee/Http/Input/Exceptions/InputValidationException.php b/src/Pecee/Http/Input/Exceptions/InputValidationException.php index 35e2cb2..9ef27a0 100644 --- a/src/Pecee/Http/Input/Exceptions/InputValidationException.php +++ b/src/Pecee/Http/Input/Exceptions/InputValidationException.php @@ -65,7 +65,13 @@ public function getErrorsForItem(string $key): ?array */ public function getDetailedMessage(): string { - return 'Failed to validate inputs: ' . (empty($this->getErrorMessages()) ? 'keine' : join('; ', $this->getErrorMessages())); + $messages = array(); + foreach ($this->getErrorMessages() as $key => $rules){ + foreach ($rules as $rule => $message){ + $messages[] = $key . ': ' . $rule . ' - ' . $message; + } + } + return 'Failed to validate inputs: ' . (sizeof($messages) === 0 ? 'keine' : join(';', $messages)); } } \ No newline at end of file