Completed
Push — master ( 4803b3...959101 )
by Frank
03:46
created

DoSomething::aggregateRootId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace With\Commands;
4
5
use EventSauce\EventSourcing\AggregateRootId;
6
use EventSauce\EventSourcing\Command;
7
use EventSauce\EventSourcing\Event;
8
use EventSauce\EventSourcing\PointInTime;
9
10
final class DoSomething implements Command
11
{
12
    /**
13
     * @var PointInTime
14
     */
15
    private $timeOfRequest;
16
17
    /**
18
     * @var AggregateRootId
19
     */
20
    private $aggregateRootId;
21
22
    /**
23
     * @var string
24
     */
25
    private $reason;
26
27
    public function __construct(
28
        AggregateRootId $aggregateRootId,
29
        PointInTime $timeOfRequest,
30
        string $reason
31
    ) {
32
        $this->aggregateRootId = $aggregateRootId;
33
        $this->timeOfRequest = $timeOfRequest;
34
        $this->reason = $reason;
35
    }
36
37
    public function timeOfRequest(): PointInTime
38
    {
39
        return $this->timeOfRequest;
40
    }
41
42
    public function aggregateRootId(): AggregateRootId
43
    {
44
        return $this->aggregateRootId;
45
    }
46
47
    public function reason(): string
48
    {
49
        return $this->reason;
50
    }
51
52
}
53