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 | use Doctrine\ORM\Mapping as ORM; |
||
8 | |||
9 | /** |
||
10 | * @ORM\Entity() |
||
11 | */ |
||
12 | class Delegate |
||
13 | { |
||
14 | /** |
||
15 | * @var integer |
||
16 | * @ORM\Id |
||
17 | * @ORM\GeneratedValue() |
||
18 | * @ORM\Column(type="integer") |
||
19 | */ |
||
20 | private $id; |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
21 | /** |
||
22 | * @var string |
||
23 | * @ORM\Column(type="string") |
||
24 | */ |
||
25 | private $delegateId; |
||
26 | /** |
||
27 | * @var string |
||
28 | * @ORM\Column(type="string") |
||
29 | */ |
||
30 | private $firstName; |
||
31 | /** |
||
32 | * @var string |
||
33 | * @ORM\Column(type="string") |
||
34 | */ |
||
35 | private $lastName; |
||
36 | /** |
||
37 | * @var string |
||
38 | * @ORM\Column(type="string") |
||
39 | */ |
||
40 | private $email; |
||
41 | /** |
||
42 | * @var string |
||
43 | * @ORM\Column(type="string") |
||
44 | */ |
||
45 | private $purchaseId; |
||
46 | /** |
||
47 | * @var string |
||
48 | * @ORM\Column(type="string") |
||
49 | */ |
||
50 | private $ticketId; |
||
51 | /** |
||
52 | * @var string |
||
53 | * @ORM\Column(type="string") |
||
54 | */ |
||
55 | private $purchaserEmail; |
||
56 | /** |
||
57 | * @var string |
||
58 | * @ORM\Column(type="boolean") |
||
59 | */ |
||
60 | private $checkedIn = false; |
||
61 | |||
62 | 5 | public function __construct(string $delegateId, DelegateInfo $delegateInfo, Ticket $ticket, string $purchaserEmail) |
|
63 | { |
||
64 | 5 | $this->delegateId = $delegateId; |
|
65 | 5 | $this->firstName = $delegateInfo->getFirstName(); |
|
66 | 5 | $this->lastName = $delegateInfo->getLastName(); |
|
67 | 5 | $this->email = $delegateInfo->getEmail(); |
|
68 | 5 | $this->purchaseId = $ticket->getPurchaseId(); |
|
69 | 5 | $this->ticketId = $ticket->getTicketId(); |
|
70 | 5 | $this->purchaserEmail = $purchaserEmail; |
|
71 | 5 | } |
|
72 | |||
73 | 3 | public function getDelegateId(): string |
|
74 | { |
||
75 | 3 | return $this->delegateId; |
|
76 | } |
||
77 | |||
78 | 2 | public function getFirstName(): string |
|
79 | { |
||
80 | 2 | return $this->firstName; |
|
81 | } |
||
82 | |||
83 | 2 | public function getLastName(): string |
|
84 | { |
||
85 | 2 | return $this->lastName; |
|
86 | } |
||
87 | |||
88 | 2 | public function getEmail(): string |
|
89 | { |
||
90 | 2 | return $this->email; |
|
91 | } |
||
92 | |||
93 | 1 | public function getPurchaseId(): string |
|
94 | { |
||
95 | 1 | return $this->purchaseId; |
|
96 | } |
||
97 | |||
98 | 1 | public function getTicketId(): string |
|
99 | { |
||
100 | 1 | return $this->ticketId; |
|
101 | } |
||
102 | |||
103 | 1 | public function getPurchaserEmail(): string |
|
104 | { |
||
105 | 1 | return $this->purchaserEmail; |
|
106 | } |
||
107 | |||
108 | 1 | public function updateDelegateInfo(DelegateInfo $delegateInfo) |
|
109 | { |
||
110 | 1 | $this->firstName = $delegateInfo->getFirstName(); |
|
111 | 1 | $this->lastName = $delegateInfo->getLastName(); |
|
112 | 1 | $this->email = $delegateInfo->getEmail(); |
|
113 | 1 | } |
|
114 | |||
115 | 2 | public function checkIn(): void |
|
116 | { |
||
117 | 2 | $this->checkedIn = true; |
|
0 ignored issues
–
show
The property
$checkedIn was declared of type string , but true is of type true . Maybe add a type cast?
This check looks for assignments to scalar types that may be of the wrong type. To ensure the code behaves as expected, it may be a good idea to add an explicit type cast. $answer = 42;
$correct = false;
$correct = (bool) $answer;
![]() |
|||
118 | 2 | } |
|
119 | |||
120 | 3 | public function checkedIn(): bool |
|
121 | { |
||
122 | 3 | return $this->checkedIn; |
|
0 ignored issues
–
show
|
|||
123 | } |
||
124 | } |