ValidationFailedException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 17
ccs 4
cts 4
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getConstraintViolationList() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JMS\Serializer\Exception;
6
7
use Symfony\Component\Validator\ConstraintViolationListInterface;
8
9
class ValidationFailedException extends RuntimeException
10
{
11
    /**
12
     * @var ConstraintViolationListInterface
13
     */
14
    private $list;
15
16 1
    public function __construct(ConstraintViolationListInterface $list)
17
    {
18 1
        parent::__construct(sprintf('Validation failed with %d error(s).', \count($list)));
19
20 1
        $this->list = $list;
21 1
    }
22
23
    public function getConstraintViolationList(): ConstraintViolationListInterface
24
    {
25
        return $this->list;
26
    }
27
}
28