Completed
Push — master ( 203e38...2cdd54 )
by Gerrit
13:04
created

FieldMapping   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 37
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getDBALColumn() 0 4 1
A describeOrigin() 0 4 1
A collectDBALColumns() 0 4 1
1
<?php
2
/**
3
 * Copyright (C) 2018 Gerrit Addiks.
4
 * This package (including this file) was released under the terms of the GPL-3.0.
5
 * You should have received a copy of the GNU General Public License along with this program.
6
 * If not, see <http://www.gnu.org/licenses/> or send me a mail so i can send you a copy.
7
 *
8
 * @license GPL-3.0
9
 *
10
 * @author Gerrit Addiks <[email protected]>
11
 */
12
13
namespace Addiks\RDMBundle\Mapping;
14
15
use Addiks\RDMBundle\Mapping\FieldMappingInterface;
16
use Doctrine\DBAL\Schema\Column;
17
18
final class FieldMapping implements FieldMappingInterface
19
{
20
21
    /**
22
     * @var Column
23
     */
24
    private $dbalColumn;
25
26
    /**
27
     * @var string
28
     */
29
    private $origin;
30
31 6
    public function __construct(
32
        Column $dbalColumn,
33
        string $origin = "unknown"
34
    ) {
35 6
        $this->dbalColumn = $dbalColumn;
36 6
        $this->origin = $origin;
37 6
    }
38
39 2
    public function getDBALColumn(): Column
40
    {
41 2
        return $this->dbalColumn;
42
    }
43
44 1
    public function describeOrigin(): string
45
    {
46 1
        return $this->origin;
47
    }
48
49 2
    public function collectDBALColumns(): array
50
    {
51 2
        return [$this->dbalColumn];
52
    }
53
54
}
55