RequestDtoValidationException::getErrors()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
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 4
    public function __construct(
15
        ConstraintViolationListInterface $errors,
16
        ?string $message = null,
17
        ?\Throwable $previous = null,
18
        array $headers = [],
19
        ?int $code = 0
20
    ) {
21 4
        parent::__construct(400, $message, $previous, $headers, $code);
22 4
        $this->errors = $errors;
23 4
    }
24
25 4
    public function getErrors(): ConstraintViolationListInterface
26
    {
27 4
        return $this->errors;
28
    }
29
}
30