Completed
Pull Request — master (#20)
by Yann
02:45
created

Record   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 74
ccs 16
cts 16
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getId() 0 4 1
A getCreatedOn() 0 4 1
A getAccount() 0 4 1
A addEntry() 0 4 1
A getEntries() 0 4 1
1
<?php
2
3
namespace Genkgo\Camt\DTO;
4
5
/**
6
 * Class Record
7
 * @package Genkgo\Camt\DTO
8
 */
9
abstract class Record
10
{
11
    /**
12
     * @var string
13
     */
14
    protected $id;
15
16
    /**
17
     * @var \DateTimeImmutable
18
     */
19
    protected $createdOn;
20
21
    /**
22
     * @var Account
23
     */
24
    protected $account;
25
26
    /**
27
     * @var array
28
     */
29
    protected $entries = [];
30
31
    /**
32
     * @param string $id
33
     * @param \DateTimeImmutable $createdOn
34
     * @param Account $account
35
     */
36 15
    public function __construct($id, \DateTimeImmutable $createdOn, Account $account)
37
    {
38 15
        $this->id = $id;
39 15
        $this->createdOn = $createdOn;
40 15
        $this->account = $account;
41 15
    }
42
43
    /**
44
     * @return string
45
     */
46 2
    public function getId()
47
    {
48 2
        return $this->id;
49
    }
50
51
    /**
52
     * @return \DateTimeImmutable
53
     */
54 2
    public function getCreatedOn()
55
    {
56 2
        return $this->createdOn;
57
    }
58
59
    /**
60
     * @return Account
61
     */
62 2
    public function getAccount()
63
    {
64 2
        return $this->account;
65
    }
66
67
    /**
68
     * @param Entry $entry
69
     */
70 13
    public function addEntry(Entry $entry)
71
    {
72 13
        $this->entries[] = $entry;
73 13
    }
74
75
    /**
76
     * @return Entry[]
77
     */
78 4
    public function getEntries()
79
    {
80 4
        return $this->entries;
81
    }
82
}
83