Code Duplication    Length = 28-28 lines in 2 locations

src/Event/DefaultEventEditingService.php 1 location

@@ 99-126 (lines=28) @@
96
    /**
97
     * @inheritdoc
98
     */
99
    public function createApprovedEvent(
100
        Language $mainLanguage,
101
        Title $title,
102
        EventType $eventType,
103
        Location $location,
104
        CalendarInterface $calendar,
105
        Theme $theme = null
106
    ) {
107
        $eventId = $this->uuidGenerator->generate();
108
109
        $event = Event::create(
110
            $eventId,
111
            $mainLanguage,
112
            $title,
113
            $eventType,
114
            $location,
115
            $calendar,
116
            $theme
117
        );
118
119
        $publicationDate = $this->publicationDate ? $this->publicationDate : new \DateTimeImmutable();
120
        $event->publish($publicationDate);
121
        $event->approve();
122
123
        $this->writeRepository->save($event);
124
125
        return $eventId;
126
    }
127
128
    /**
129
     * @inheritdoc

src/Place/DefaultPlaceEditingService.php 1 location

@@ 89-116 (lines=28) @@
86
    /**
87
     * @inheritdoc
88
     */
89
    public function createApprovedPlace(
90
        Language $mainLanguage,
91
        Title $title,
92
        EventType $eventType,
93
        Address $address,
94
        CalendarInterface $calendar,
95
        Theme $theme = null
96
    ) {
97
        $id = $this->uuidGenerator->generate();
98
99
        $place = Place::createPlace(
100
            $id,
101
            $mainLanguage,
102
            $title,
103
            $eventType,
104
            $address,
105
            $calendar,
106
            $theme
107
        );
108
109
        $publicationDate = $this->publicationDate ? $this->publicationDate : new \DateTimeImmutable();
110
        $place->publish($publicationDate);
111
        $place->approve();
112
113
        $this->writeRepository->save($place);
114
115
        return $id;
116
    }
117
118
    /**
119
     * {@inheritdoc}