Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
ValidationException
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getValidator
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Engelsystem\Http\Exceptions;
6
7use Engelsystem\Http\Validation\Validator;
8use RuntimeException;
9use Throwable;
10
11class ValidationException extends RuntimeException
12{
13    /**
14     * @param Throwable|null $previous
15     */
16    public function __construct(
17        protected Validator $validator,
18        string $message = '',
19        int $code = 0,
20        Throwable $previous = null
21    ) {
22        parent::__construct($message, $code, $previous);
23    }
24
25    public function getValidator(): Validator
26    {
27        return $this->validator;
28    }
29}