Completed
Push — master ( 860638...4d5894 )
by Frank
02:47 queued 01:15
created

DummyTaskWasExecuted   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 43
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace EventSauce\EventSourcing\Integration\TestingAggregates;
4
5
use EventSauce\EventSourcing\AggregateRootId;
6
use EventSauce\EventSourcing\Event;
7
use EventSauce\EventSourcing\PointInTime;
8
9
/**
10
 * @codeCoverageIgnore
11
 */
12
class DummyTaskWasExecuted implements Event
13
{
14
    /**
15
     * @var AggregateRootId
16
     */
17
    private $aggregateRootId;
18
19
    /**
20
     * @var PointInTime
21
     */
22
    private $timeOfRecording;
23
24
    public function __construct(AggregateRootId $aggregateRootId, PointInTime $timeOfRecording)
25
    {
26
        $this->aggregateRootId = $aggregateRootId;
27
        $this->timeOfRecording = $timeOfRecording;
28
    }
29
30
    public function aggregateRootId(): AggregateRootId
31
    {
32
        return $this->aggregateRootId;
33
    }
34
35
    public function eventVersion(): int
36
    {
37
        return 1;
38
    }
39
40
    public function timeOfRecording(): PointInTime
41
    {
42
        return $this->timeOfRecording;
43
    }
44
45
    public function toPayload(): array
46
    {
47
        return [];
48
    }
49
50
    public static function fromPayload(array $payload, AggregateRootId $aggregateRootId, PointInTime $timeOfRecording): Event
51
    {
52
        return new DummyTaskWasExecuted($aggregateRootId, $timeOfRecording);
53
    }
54
}