| Total Complexity | 3 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php declare(strict_types=1); |
||
| 10 | class EntityInvalidException extends SeverityAwareException |
||
| 11 | { |
||
| 12 | protected const MESSAGE = 'Entity failed validation: %s'; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var mixed |
||
| 16 | */ |
||
| 17 | protected $errors; |
||
| 18 | |||
| 19 | public function __construct( |
||
| 20 | string $message = '', |
||
| 21 | int $code = 0, |
||
| 22 | array $errors = [], |
||
| 23 | ?Throwable $previous = null, |
||
| 24 | int $severityLevel = self::SEVERITY_INFO |
||
| 25 | ) { |
||
| 26 | parent::__construct($message, $code, $previous, $severityLevel); |
||
| 27 | |||
| 28 | $this->errors = $errors; |
||
| 29 | } |
||
| 30 | |||
| 31 | public static function invalid(string $message, int $code, array $errors): self |
||
| 39 | ); |
||
| 40 | } |
||
| 41 | |||
| 42 | public function getErrors(): array |
||
| 47 |