Code Duplication    Length = 12-12 lines in 2 locations

src/Place/Place.php 2 locations

@@ 196-207 (lines=12) @@
193
        $this->addresses[$addressTranslated->getLanguage()->getCode()] = $addressTranslated->getAddress();
194
    }
195
196
    public function markAsDuplicateOf(string $placeIdOfCanonical): void
197
    {
198
        if ($this->isDeleted) {
199
            throw CannotMarkPlaceAsDuplicate::becauseItIsDeleted($this->placeId);
200
        }
201
202
        if ($this->isDuplicate) {
203
            throw CannotMarkPlaceAsDuplicate::becauseItIsAlreadyADuplicate($this->placeId);
204
        }
205
206
        $this->apply(new MarkedAsDuplicate($this->placeId, $placeIdOfCanonical));
207
    }
208
209
    public function markAsCanonicalFor(string $placeIdOfDuplicate, array $duplicatesOfDuplicate = []): void
210
    {
@@ 209-220 (lines=12) @@
206
        $this->apply(new MarkedAsDuplicate($this->placeId, $placeIdOfCanonical));
207
    }
208
209
    public function markAsCanonicalFor(string $placeIdOfDuplicate, array $duplicatesOfDuplicate = []): void
210
    {
211
        if ($this->isDeleted) {
212
            throw CannotMarkPlaceAsCanonical::becauseItIsDeleted($this->placeId);
213
        }
214
215
        if ($this->isDuplicate) {
216
            throw CannotMarkPlaceAsCanonical::becauseItIsAlreadyADuplicate($this->placeId);
217
        }
218
219
        $this->apply(new MarkedAsCanonical($this->placeId, $placeIdOfDuplicate, $duplicatesOfDuplicate));
220
    }
221
222
    /**
223
     * @return string[]