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

MockValue   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 7
c 1
b 0
f 0
dl 0
loc 24
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A makeEmpty() 0 3 1
A getValue() 0 3 1
A __construct() 0 3 1
A customFactory() 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\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