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
        LocationId $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

@@ 98-121 (lines=24) @@
95
    /**
96
     * @todo Rename this method to create() after moving this part of the codebase to udb3-silex
97
     */
98
    public static function createPlace(
99
        string $id,
100
        Language $mainLanguage,
101
        Title $title,
102
        EventType $eventType,
103
        Address $address,
104
        CalendarInterface $calendar,
105
        Theme $theme = null,
106
        DateTimeImmutable $publicationDate = null
107
    ): self {
108
        $place = new self();
109
        $place->apply(new PlaceCreated(
110
            $id,
111
            $mainLanguage,
112
            $title,
113
            $eventType,
114
            $address,
115
            $calendar,
116
            $theme,
117
            $publicationDate
118
        ));
119
120
        return $place;
121
    }
122
123
    protected function applyPlaceCreated(PlaceCreated $placeCreated): void
124
    {