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

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