Completed
Push — master ( 9dfe4a...9f73a9 )
by Alexey
03:27
created

RequestDtoValidationException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 5
dl 0
loc 9
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Nelexa\RequestDtoBundle\Exception;
6
7
use Symfony\Component\HttpKernel\Exception\HttpException;
8
use Symfony\Component\Validator\ConstraintViolationListInterface;
9
10
class RequestDtoValidationException extends HttpException
11
{
12
    private ConstraintViolationListInterface $errors;
13
14 3
    public function __construct(
15
        ConstraintViolationListInterface $errors,
16
        ?string $message = null,
17
        ?\Throwable $previous = null,
18
        array $headers = [],
19
        ?int $code = 0
20
    ) {
21 3
        parent::__construct(400, $message, $previous, $headers, $code);
22 3
        $this->errors = $errors;
23 3
    }
24
25 3
    public function getErrors(): ConstraintViolationListInterface
26
    {
27 3
        return $this->errors;
28
    }
29
}
30