Completed
Push — master ( c63c12...520404 )
by Frank
03:37 queued 01:34
created

DoSomething   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 43
rs 10
c 0
b 0
f 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
11
final class DoSomething implements Command
12
{
13
    /**
14
     * @var PointInTime
15
     */
16
    private $timeOfRequest;
17
18
    /**
19
     * @var AggregateRootId
20
     */
21
    private $aggregateRootId;
22
23
    /**
24
     * @var string
25
     */
26
    private $reason;
27
28
    public function __construct(
29
        AggregateRootId $aggregateRootId,
30
        PointInTime $timeOfRequest,
31
        string $reason
32
    ) {
33
        $this->aggregateRootId = $aggregateRootId;
34
        $this->timeOfRequest = $timeOfRequest;
35
        $this->reason = $reason;
36
    }
37
38
    public function timeOfRequest(): PointInTime
39
    {
40
        return $this->timeOfRequest;
41
    }
42
43
    public function aggregateRootId(): AggregateRootId
44
    {
45
        return $this->aggregateRootId;
46
    }
47
48
    public function reason(): string
49
    {
50
        return $this->reason;
51
    }
52
53
}
54
55