Completed
Push — master ( b67e90...998fa4 )
by Constantin
06:57
created

CommandMetadata::withoutCorrelationId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Copyright (c) 2018 Constantin Galbenu <[email protected]>
4
 */
5
6
namespace Gica\Cqrs\Command;
7
8
9
use Gica\Types\Guid;
10
11
class CommandMetadata
12
{
13
    /** @var Guid|null */
14
    private $commandId = null;
15
16
    /** @var Guid|null */
17
    private $correlationId = null;
18
19 1
    public function getCommandId():?Guid
20
    {
21 1
        return $this->commandId;
22
    }
23
24
    /**
25
     * @param Guid $commandId
26
     * @return static
27
     */
28 2
    public function withCommandId(Guid $commandId)
29
    {
30 2
        $other = clone $this;
31 2
        $other->commandId = $commandId;
32 2
        return $other;
33
    }
34
35
    /**
36
     * @return static
37
     */
38 1
    public function withoutCommandId()
39
    {
40 1
        $other = clone $this;
41 1
        $other->commandId = null;
42 1
        return $other;
43
    }
44
45 1
    public function getCorrelationId():?Guid
46
    {
47 1
        return $this->correlationId;
48
    }
49
50
    /**
51
     * @param Guid $correlationId
52
     * @return static
53
     */
54 1
    public function withCorrelationId(Guid $correlationId)
55
    {
56 1
        $other = clone $this;
57 1
        $other->correlationId = $correlationId;
58 1
        return $other;
59
    }
60
61
    /**
62
     * @return static
63
     */
64 1
    public function withoutCorrelationId()
65
    {
66 1
        $other = clone $this;
67 1
        $other->correlationId = null;
68 1
        return $other;
69
    }
70
}