Code Duplication    Length = 24-27 lines in 2 locations

src/Event/Event.php 1 location

@@ 113-139 (lines=27) @@
110
     * @param \DateTimeImmutable|null $publicationDate
111
     * @return Event
112
     */
113
    public static function create(
114
        $eventId,
115
        Language $mainLanguage,
116
        Title $title,
117
        EventType $eventType,
118
        Location $location,
119
        CalendarInterface $calendar,
120
        Theme $theme = null,
121
        \DateTimeImmutable $publicationDate = null
122
    ) {
123
        $event = new self();
124
125
        $event->apply(
126
            new EventCreated(
127
                $eventId,
128
                $mainLanguage,
129
                $title,
130
                $eventType,
131
                $location,
132
                $calendar,
133
                $theme,
134
                $publicationDate
135
            )
136
        );
137
138
        return $event;
139
    }
140
141
    /**
142
     * @param string $newEventId

src/Place/Place.php 1 location

@@ 111-134 (lines=24) @@
108
     *
109
     * @return self
110
     */
111
    public static function createPlace(
112
        $id,
113
        Language $mainLanguage,
114
        Title $title,
115
        EventType $eventType,
116
        Address $address,
117
        CalendarInterface $calendar,
118
        Theme $theme = null,
119
        DateTimeImmutable $publicationDate = null
120
    ) {
121
        $place = new self();
122
        $place->apply(new PlaceCreated(
123
            $id,
124
            $mainLanguage,
125
            $title,
126
            $eventType,
127
            $address,
128
            $calendar,
129
            $theme,
130
            $publicationDate
131
        ));
132
133
        return $place;
134
    }
135
136
    /**
137
     * Apply the place created event.