File manager - Edit - /home/webapp69.cm.in.th/u69319090028/Shop/app/Core/Exceptions/ValidationException.php
Back
<?php /** * Validation Exception (HTTP 422) */ require_once __DIR__ . '/AppException.php'; class ValidationException extends AppException { private array $errors = []; public function __construct(array $errors, string $message = 'ข้อมูลที่ส่งมาไม่ถูกต้องตามเกณฑ์') { $this->errors = $errors; parent::__construct($message, 422, 'VALIDATION_FAILED', ['errors' => $errors]); } public function getErrors(): array { return $this->errors; } public function getFirstError(): ?string { return reset($this->errors) ?: null; } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.24 |
proxy
|
phpinfo
|
Settings