DonorEventEntry   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
dl 0
loc 55
rs 10
c 1
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A getDateTime() 0 3 1
A getMandateKey() 0 3 1
A __construct() 0 6 1
A getData() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of byrokrat\giroapp.
5
 *
6
 * byrokrat\giroapp is free software: you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License as published
8
 * by the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * byrokrat\giroapp is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with byrokrat\giroapp. If not, see <http://www.gnu.org/licenses/>.
18
 *
19
 * Copyright 2016-21 Hannes Forsgård
20
 */
21
22
declare(strict_types=1);
23
24
namespace byrokrat\giroapp\Db;
25
26
class DonorEventEntry
27
{
28
    /** @var string */
29
    private $mandateKey;
30
31
    /** @var string */
32
    private $type;
33
34
    /** @var \DateTimeImmutable */
35
    private $datetime;
36
37
    /** @var string[] */
38
    private $data;
39
40
    /**
41
     * @param string[] $data
42
     */
43
    public function __construct(string $mandateKey, string $type, \DateTimeImmutable $datetime, array $data)
44
    {
45
        $this->mandateKey = $mandateKey;
46
        $this->type = $type;
47
        $this->datetime = $datetime;
48
        $this->data = $data;
49
    }
50
51
    /**
52
     * Key of referenced mandate
53
     */
54
    public function getMandateKey(): string
55
    {
56
        return $this->mandateKey;
57
    }
58
59
    /**
60
     * The type of event recorded
61
     */
62
    public function getType(): string
63
    {
64
        return $this->type;
65
    }
66
67
    /**
68
     * Time of recording
69
     */
70
    public function getDateTime(): \DateTimeImmutable
71
    {
72
        return $this->datetime;
73
    }
74
75
    /**
76
     * @return string[] Type dependent event data
77
     */
78
    public function getData(): array
79
    {
80
        return $this->data;
81
    }
82
}
83