Event   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 6
eloc 16
dl 0
loc 59
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A createdAt() 0 3 1
A getName() 0 3 1
A getVersion() 0 3 1
A getDomain() 0 3 1
A __construct() 0 7 1
A getPayload() 0 3 1
1
<?php
2
/**
3
 *
4
 * This file is part of the Aggrego.
5
 * (c) Tomasz Kunicki <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 */
11
declare(strict_types = 1);
12
13
namespace Aggrego\EventConsumer\Shared;
14
15
use Aggrego\EventConsumer\Event as EventInterface;
16
use Aggrego\EventConsumer\Event\CreatedAt;
17
use Aggrego\EventConsumer\Event\Domain;
18
use Aggrego\EventConsumer\Event\Name;
19
use Aggrego\EventConsumer\Event\Version;
20
21
class Event implements EventInterface
22
{
23
    /**
24
     * @var Domain
25
     */
26
    private $domain;
27
28
    /**
29
     * @var Name
30
     */
31
    private $name;
32
33
    /**
34
     * @var CreatedAt
35
     */
36
    private $createdAt;
37
38
    /**
39
     * @var Version
40
     */
41
    private $version;
42
43
    /**
44
     * @var array
45
     */
46
    private $data;
47
48
    public function __construct(Domain $domain, Name $name, CreatedAt $createdAt, Version $version, array $data)
49
    {
50
        $this->domain = $domain;
51
        $this->createdAt = $createdAt;
52
        $this->version = $version;
53
        $this->data = $data;
54
        $this->name = $name;
55
    }
56
57
    public function getDomain(): Domain
58
    {
59
        return $this->domain;
60
    }
61
62
    public function getName(): Name
63
    {
64
        return $this->name;
65
    }
66
67
    public function createdAt(): CreatedAt
68
    {
69
        return $this->createdAt;
70
    }
71
72
    public function getVersion(): Version
73
    {
74
        return $this->version;
75
    }
76
77
    public function getPayload(): array
78
    {
79
        return $this->data;
80
    }
81
}
82