Skip to content

Commit

Permalink
fixed array to string conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
DeveloperMarius committed Mar 5, 2024
1 parent d06a6ad commit fdf4cef
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Pecee/Http/Input/Exceptions/InputValidationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

}

0 comments on commit fdf4cef

Please sign in to comment.