Completed
Push — master ( 860638...4d5894 )
by Frank
02:47 queued 01:15
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
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