Passed
Push — master ( 4327f5...645913 )
by Chris
03:00
created

Delegate::updateDelegateInfo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 9.4285
ccs 4
cts 4
cp 1
crap 1
1
<?php
2
3
namespace ConferenceTools\Checkin\Domain\ReadModel;
4
5
use ConferenceTools\Checkin\Domain\ValueObject\DelegateInfo;
6
use ConferenceTools\Checkin\Domain\ValueObject\Ticket;
7
8
class Delegate
9
{
10
    private $id;
0 ignored issues
show
introduced by
The private property $id is not used, and could be removed.
Loading history...
11
12
    private $delegateId;
13
14
    private $firstName;
15
16
    private $lastName;
17
18
    private $email;
19
20
    private $purchaseId;
21
22
    private $ticketId;
23
    /**
24
     * @var string
25
     */
26
    private $purchaserEmail;
27
28
    private $checkedIn = false;
29
30 5
    public function __construct(string $delegateId, DelegateInfo $delegateInfo, Ticket $ticket, string $purchaserEmail)
31
    {
32 5
        $this->delegateId = $delegateId;
33 5
        $this->firstName = $delegateInfo->getFirstName();
34 5
        $this->lastName = $delegateInfo->getLastName();
35 5
        $this->email = $delegateInfo->getEmail();
36 5
        $this->purchaseId = $ticket->getPurchaseId();
37 5
        $this->ticketId = $ticket->getTicketId();
38 5
        $this->purchaserEmail = $purchaserEmail;
39 5
    }
40
41 3
    public function getDelegateId(): string
42
    {
43 3
        return $this->delegateId;
44
    }
45
46 2
    public function getFirstName(): string
47
    {
48 2
        return $this->firstName;
49
    }
50
51 2
    public function getLastName(): string
52
    {
53 2
        return $this->lastName;
54
    }
55
56 2
    public function getEmail(): string
57
    {
58 2
        return $this->email;
59
    }
60
61 1
    public function getPurchaseId(): string
62
    {
63 1
        return $this->purchaseId;
64
    }
65
66 1
    public function getTicketId(): string
67
    {
68 1
        return $this->ticketId;
69
    }
70
71 1
    public function getPurchaserEmail(): string
72
    {
73 1
        return $this->purchaserEmail;
74
    }
75
76 1
    public function updateDelegateInfo(DelegateInfo $delegateInfo)
77
    {
78 1
        $this->firstName = $delegateInfo->getFirstName();
79 1
        $this->lastName = $delegateInfo->getLastName();
80 1
        $this->email = $delegateInfo->getEmail();
81 1
    }
82
83 2
    public function checkIn(): void
84
    {
85 2
        $this->checkedIn = true;
86 2
    }
87
88 3
    public function checkedIn(): bool
89
    {
90 3
        return $this->checkedIn;
91
    }
92
}