Passed
Push — master ( 12496d...1d459e )
by Mr
07:53
created

AnnotatedValue   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 8
c 1
b 0
f 0
dl 0
loc 23
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getMockValue() 0 3 1
A getOtherMockValue() 0 3 1
A getDefaultFactoryMockValue() 0 3 1
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the daikon-cqrs/interop project.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Daikon\Tests\Interop\Fixture;
10
11
use Daikon\Interop\FromNativeInterface;
12
use Daikon\Interop\FromToNativeTrait;
13
use Daikon\Interop\ToNativeInterface;
14
15
/**
16
 * @map(mockValue, Daikon\Tests\Interop\Fixture\MockValue::fromNative)
17
 * @map(otherMockValue, Daikon\Tests\Interop\Fixture\MockValue::customFactory)
18
 * @map(defaultFactoryMockValue, Daikon\Tests\Interop\Fixture\MockValue)
19
 */
20
final class AnnotatedValue implements FromNativeInterface, ToNativeInterface
21
{
22
    use FromToNativeTrait;
23
24
    private ?MockValue $mockValue;
25
26
    private MockValue $otherMockValue;
27
28
    private MockValue $defaultFactoryMockValue;
29
30
    public function getMockValue(): MockValue
31
    {
32
        return $this->mockValue ?? MockValue::makeEmpty();
33
    }
34
35
    public function getOtherMockValue(): MockValue
36
    {
37
        return $this->otherMockValue;
38
    }
39
40
    public function getDefaultFactoryMockValue(): MockValue
41
    {
42
        return $this->defaultFactoryMockValue;
43
    }
44
}
45