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

MockValue::getValue()   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
final class MockValue implements FromNativeInterface, ToNativeInterface, MakeEmptyInterface
17
{
18
    use FromToNativeTrait;
19
20
    private ?string $value;
21
22
    public static function makeEmpty(): self
23
    {
24
        return new self;
25
    }
26
27
    public static function customFactory(array $state): self
28
    {
29
        return new self($state['custom']);
30
    }
31
32
    public function getValue(): ?string
33
    {
34
        return $this->value;
35
    }
36
37
    private function __construct(string $value = null)
38
    {
39
        $this->value = $value;
40
    }
41
}
42