Completed
Pull Request — master (#286)
by
unknown
02:48
created

ValidationException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 50%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 3
c 4
b 0
f 0
lcom 0
cbo 0
dl 0
loc 38
ccs 4
cts 8
cp 0.5
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getViolations() 0 4 1
A getLineNumber() 0 4 1
1
<?php
2
3
namespace Ddeboer\DataImport\Exception;
4
5
use Ddeboer\DataImport\Exception;
6
use Symfony\Component\Validator\ConstraintViolationListInterface;
7
8
/**
9
 * @author Markus Bachmann <[email protected]>
10
 */
11
class ValidationException extends \Exception implements Exception
12
{
13
    /**
14
     * @var ConstraintViolationListInterface
15
     */
16
    private $violations;
17
18
    /**
19
     * @var integer
20
     */
21
    private $lineNumber;
22
23
    /**
24
     * @param ConstraintViolationListInterface $list
25
     * @param integer                          $line
26
     */
27 1
    public function __construct(ConstraintViolationListInterface $list, $line)
28
    {
29 1
        $this->violations = $list;
30 1
        $this->lineNumber = $line;
31 1
    }
32
33
    /**
34
     * @return ConstraintViolationListInterface
35
     */
36
    public function getViolations()
37
    {
38
        return $this->violations;
39
    }
40
41
    /**
42
     * @return integer
43
     */
44
    public function getLineNumber()
45
    {
46
        return $this->lineNumber;
47
    }
48
}
49