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

FieldMapping::getDBALColumn()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 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