Skip to content

Commit 1470688

Browse files
committed
Use enums
1 parent 699d86e commit 1470688

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

backend/app/Services/Domain/Event/DuplicateEventService.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use HiEvents\DomainObjects\CapacityAssignmentDomainObject;
66
use HiEvents\DomainObjects\CheckInListDomainObject;
77
use HiEvents\DomainObjects\Enums\EventImageType;
8+
use HiEvents\DomainObjects\Enums\QuestionBelongsTo;
89
use HiEvents\DomainObjects\EventDomainObject;
910
use HiEvents\DomainObjects\EventSettingDomainObject;
1011
use HiEvents\DomainObjects\ImageDomainObject;
@@ -181,7 +182,7 @@ private function cloneExistingTickets(
181182
private function clonePerTicketQuestions(EventDomainObject $event, int $newEventId, array $oldTicketToNewTicketMap): void
182183
{
183184
foreach ($event->getQuestions() as $question) {
184-
if ($question->getBelongsTo() == "TICKET") {
185+
if ($question->getBelongsTo() === QuestionBelongsTo::TICKET->name) {
185186
$this->createQuestionService->createQuestion(
186187
(new QuestionDomainObject())
187188
->setTitle($question->getTitle())
@@ -206,7 +207,7 @@ private function clonePerTicketQuestions(EventDomainObject $event, int $newEvent
206207
private function clonePerOrderQuestions(EventDomainObject $event, int $newEventId): void
207208
{
208209
foreach ($event->getQuestions() as $question) {
209-
if ($question->getBelongsTo() == "ORDER") {
210+
if ($question->getBelongsTo() === QuestionBelongsTo::ORDER->name) {
210211
$this->createQuestionService->createQuestion(
211212
(new QuestionDomainObject())
212213
->setTitle($question->getTitle())

0 commit comments

Comments
 (0)