Passed
Pull Request — master (#41)
by Thomas
03:10
created

NotValid   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 21
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
1
<?php
2
3
namespace ORM\Dbal\Error;
4
5
use ORM\Dbal\Column;
6
use ORM\Dbal\Error;
7
8
class NotValid extends Error
9
{
10
    const ERROR_CODE = 'NOT_VALID';
11
12
    /** @var string */
13
    protected $message = 'Value not valid for %column% (Caused by: %previous%)';
14
15
    /**
16
     * NotValid constructor
17
     *
18
     * @param Column $column The column that got a not valid error
19
     * @param Error  $previous The error from validate
20
     */
21 3
    public function __construct(Column $column, Error $previous)
22
    {
23 3
        parent::__construct([
24 3
            'column' => $column->name,
25 3
            'previous' => $previous->getMessage()
26 3
        ], null, null, $previous);
27 3
    }
28
}
29