NullMapping::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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\MappingInterface;
16
use Webmozart\Assert\Assert;
17
use Doctrine\DBAL\Schema\Column;
18
use Addiks\RDMBundle\Hydration\HydrationContextInterface;
19
use Symfony\Component\DependencyInjection\ContainerInterface;
20
21
final class NullMapping implements MappingInterface
22
{
23
24
    /**
25
     * @var string
26
     */
27
    private $origin;
28
29 7
    public function __construct(string $origin = "unknown")
30
    {
31 7
        $this->origin = $origin;
32
    }
33
34 1
    public function describeOrigin(): string
35
    {
36 1
        return $this->origin;
37
    }
38
39 1
    public function collectDBALColumns(): array
40
    {
41 1
        return [];
42
    }
43
44 1
    public function resolveValue(
45
        HydrationContextInterface $context,
46
        array $dataFromAdditionalColumns
47
    ) {
48 1
        return null;
49
    }
50
51 1
    public function revertValue(
52
        HydrationContextInterface $context,
53
        $valueFromEntityField
54
    ): array {
55 1
        return array();
56
    }
57
58
    public function assertValue(
59
        HydrationContextInterface $context,
60
        array $dataFromAdditionalColumns,
61
        $actualValue
62
    ): void {
63
    }
64
65
    public function wakeUpMapping(ContainerInterface $container): void
66
    {
67
    }
68
69
}
70