$propertyErrors) { $errorString .= implode("\r\n", $propertyErrors); } $exception = new self('Validation failed with following errors: ' . "\n\n" . $errorString); $exception->errors = $errors; return $exception; } /** * @return array */ public function getErrors(): array { return $this->errors; } }