Code Duplication    Length = 8-8 lines in 2 locations

src/Offer/Offer.php 1 location

@@ 291-298 (lines=8) @@
288
289
        // Fire a LabelsImported for all new labels.
290
        $importLabels = new Labels();
291
        foreach ($addedLabels->asArray() as $addedLabel) {
292
            $importLabels = $importLabels->with(
293
                new \CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label(
294
                    new LabelName((string) $addedLabel),
295
                    $addedLabel->isVisible()
296
                )
297
            );
298
        }
299
        if ($importLabels->count() > 0) {
300
            $this->apply($this->createLabelsImportedEvent($importLabels));
301
        }

src/Organizer/Organizer.php 1 location

@@ 286-293 (lines=8) @@
283
284
        // Fire a LabelsImported for all new labels.
285
        $importLabels = new Labels();
286
        foreach ($addedLabels->asArray() as $addedLabel) {
287
            $importLabels = $importLabels->with(
288
                new \CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label(
289
                    new LabelName((string) $addedLabel),
290
                    $addedLabel->isVisible()
291
                )
292
            );
293
        }
294
        if ($importLabels->count() > 0) {
295
            $this->apply(new LabelsImported(
296
                $this->actorId,