Code Duplication    Length = 22-25 lines in 2 locations

src/Event/Event.php 1 location

@@ 95-119 (lines=25) @@
92
     * @param \DateTimeImmutable|null $publicationDate
93
     * @return Event
94
     */
95
    public static function create(
96
        $eventId,
97
        Title $title,
98
        EventType $eventType,
99
        Location $location,
100
        CalendarInterface $calendar,
101
        Theme $theme = null,
102
        \DateTimeImmutable $publicationDate = null
103
    ) {
104
        $event = new self();
105
106
        $event->apply(
107
            new EventCreated(
108
                $eventId,
109
                $title,
110
                $eventType,
111
                $location,
112
                $calendar,
113
                $theme,
114
                $publicationDate
115
            )
116
        );
117
118
        return $event;
119
    }
120
121
    /**
122
     * @param string $newEventId

src/Place/Place.php 1 location

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