diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2019-07-09 21:43:18 +0200 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2019-07-09 21:43:18 +0200 |
commit | 7414f9b23dbcc66e5f0efda3d0cbfd79372ec780 (patch) | |
tree | 891a11b71d8b25922fc4b343dbc77a01a0646ba1 /src/Http/Exceptions/ValidationException.php | |
parent | 508695efb253d7bc0caea1fa017ed5608d774596 (diff) |
Implemented Validation for controllers
Diffstat (limited to 'src/Http/Exceptions/ValidationException.php')
-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; + } +} |