RequestDtoValidationException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 18
ccs 6
cts 6
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A getErrors() 0 3 1
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