Code Duplication    Length = 8-8 lines in 2 locations

src/Offer/Offer.php 1 location

@@ 306-313 (lines=8) @@
303
304
        // Fire a LabelsImported for all new labels.
305
        $importLabels = new Labels();
306
        foreach ($addedLabels->asArray() as $addedLabel) {
307
            $importLabels = $importLabels->with(
308
                new \CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label(
309
                    new LabelName((string) $addedLabel),
310
                    $addedLabel->isVisible()
311
                )
312
            );
313
        }
314
        if ($importLabels->count() > 0) {
315
            $this->apply($this->createLabelsImportedEvent($importLabels));
316
        }

src/Organizer/Organizer.php 1 location

@@ 314-321 (lines=8) @@
311
312
        // Fire a LabelsImported for all new labels.
313
        $importLabels = new Labels();
314
        foreach ($addedLabels->asArray() as $addedLabel) {
315
            $importLabels = $importLabels->with(
316
                new \CultuurNet\UDB3\Model\ValueObject\Taxonomy\Label\Label(
317
                    new LabelName((string) $addedLabel),
318
                    $addedLabel->isVisible()
319
                )
320
            );
321
        }
322
        if ($importLabels->count() > 0) {
323
            $this->apply(new LabelsImported(
324
                $this->actorId,