Completed
Pull Request — master (#2)
by Samuel
04:21
created

MutationException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 28
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getConstraintViolations() 0 4 1
1
<?php
2
3
namespace App\Common\Domain;
4
5
use Symfony\Component\Validator\ConstraintViolationListInterface;
6
7
class MutationException extends \RuntimeException
8
{
9
    /**
10
     * @var ConstraintViolationListInterface
11
     */
12
    private $constraintViolations;
13
14
    /**
15
     * @param ConstraintViolationListInterface $constraintViolations
16
     * @param string $message
17
     * @param int $code
18
     * @param \Exception|null $previous
19
     */
20
    public function __construct(ConstraintViolationListInterface $constraintViolations, $message = '', $code = 0, \Exception $previous = null)
21
    {
22
        $this->constraintViolations = $constraintViolations;
23
24
        parent::__construct($message, $code, $previous);
25
    }
26
27
    /**
28
     * @return ConstraintViolationListInterface
29
     */
30
    public function getConstraintViolations(): ConstraintViolationListInterface
31
    {
32
        return $this->constraintViolations;
33
    }
34
}
35