Code Duplication    Length = 22-25 lines in 2 locations

src/Event/Event.php 1 location

@@ 105-129 (lines=25) @@
102
     * @param \DateTimeImmutable|null $publicationDate
103
     * @return Event
104
     */
105
    public static function create(
106
        $eventId,
107
        Title $title,
108
        EventType $eventType,
109
        Location $location,
110
        CalendarInterface $calendar,
111
        Theme $theme = null,
112
        \DateTimeImmutable $publicationDate = null
113
    ) {
114
        $event = new self();
115
116
        $event->apply(
117
            new EventCreated(
118
                $eventId,
119
                $title,
120
                $eventType,
121
                $location,
122
                $calendar,
123
                $theme,
124
                $publicationDate
125
            )
126
        );
127
128
        return $event;
129
    }
130
131
    /**
132
     * @param string $newEventId

src/Place/Place.php 1 location

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