Passed
Push — master ( 4efb65...8ee2ab )
by Mr
01:53
created

AnnotatedValue::getMockValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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\MakeEmptyInterface;
14
use Daikon\Interop\ToNativeInterface;
15
16
/**
17
 * @map(mockValue, Daikon\Tests\Interop\Fixture\MockValue::fromNative)
18
 * @map(otherMockValue, Daikon\Tests\Interop\Fixture\MockValue::customFactory)
19
 */
20
final class AnnotatedValue implements FromNativeInterface, ToNativeInterface, MakeEmptyInterface
21
{
22
    use FromToNativeTrait;
23
24
    private ?MockValue $mockValue;
25
26
    private MockValue $otherMockValue;
27
28
    public static function makeEmpty(): self
29
    {
30
        return new self;
31
    }
32
33
    public function getMockValue(): MockValue
34
    {
35
        return $this->mockValue ?? MockValue::makeEmpty();
36
    }
37
38
    public function getOtherMockValue(): MockValue
39
    {
40
        return $this->otherMockValue;
41
    }
42
}
43