Code Duplication    Length = 8-8 lines in 2 locations

src/Offer/Offer.php 1 location

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

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,