engelsystem/src/Http/Exceptions/ValidationException.php

31 lines
628 B
PHP
Raw Normal View History

2019-07-09 21:43:18 +02:00
<?php
namespace Engelsystem\Http\Exceptions;
use Engelsystem\Http\Validation\Validator;
use RuntimeException;
use Throwable;
class ValidationException extends RuntimeException
{
protected Validator $validator;
2019-07-09 21:43:18 +02:00
/**
* @param Throwable|null $previous
*/
public function __construct(
Validator $validator,
string $message = '',
int $code = 0,
Throwable $previous = null
) {
$this->validator = $validator;
parent::__construct($message, $code, $previous);
}
public function getValidator(): Validator
{
return $this->validator;
}
}