diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2019-07-21 13:42:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-21 13:42:19 +0200 |
commit | 43fa21f6553bb9e46f00d0768eab56e74c842bb4 (patch) | |
tree | 00df255fcd7c3777855bee27967117440c4add8c /src/Http/Exceptions | |
parent | 4f60daa29568a43ab1da761d89124308dc7b37e7 (diff) | |
parent | 1e16f4c47ec15ffea41e1fa612d205b8db2a16d1 (diff) |
Merge branch 'master' into docker
Diffstat (limited to 'src/Http/Exceptions')
-rw-r--r-- | src/Http/Exceptions/ValidationException.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/Http/Exceptions/ValidationException.php b/src/Http/Exceptions/ValidationException.php new file mode 100644 index 00000000..e48fb0c3 --- /dev/null +++ b/src/Http/Exceptions/ValidationException.php @@ -0,0 +1,37 @@ +<?php + +namespace Engelsystem\Http\Exceptions; + +use Engelsystem\Http\Validation\Validator; +use RuntimeException; +use Throwable; + +class ValidationException extends RuntimeException +{ + /** @var Validator */ + protected $validator; + + /** + * @param Validator $validator + * @param string $message + * @param int $code + * @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); + } + + /** + * @return Validator + */ + public function getValidator(): Validator + { + return $this->validator; + } +} |