Completed
Push — master ( 83404d...ab1330 )
by Rafał
14:45
created

ValidationException::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 4
1
<?php
2
3
namespace SWP\Bundle\BridgeBundle\Exception;
4
5
use Symfony\Component\Validator\ConstraintViolationListInterface;
6
7
final class ValidationException extends \RuntimeException
8
{
9
    /**
10
     * @var ConstraintViolationListInterface
11
     */
12
    private $constraintViolationList;
13
14
    /**
15
     * ValidationException constructor.
16
     *
17
     * @param ConstraintViolationListInterface $constraintViolationList
18
     * @param string                           $message
19
     * @param int                              $code
20
     * @param \Exception|null                  $previous
21
     */
22
    public function __construct(ConstraintViolationListInterface $constraintViolationList, $message = '', $code = 0, \Exception $previous = null)
23
    {
24
        parent::__construct($message, $code, $previous);
25
26
        $this->constraintViolationList = $constraintViolationList;
27
    }
28
29
    /**
30
     * Gets constraint violations as a list.
31
     *
32
     * @return ConstraintViolationListInterface
33
     */
34
    public function getConstraintViolationList()
35
    {
36
        return $this->constraintViolationList;
37
    }
38
}
39