Code Duplication    Length = 10-10 lines in 2 locations

src/Organizer/OrganizerCommandHandler.php 1 location

@@ 184-193 (lines=10) @@
181
     * @param AbstractLabelCommand $labelCommand
182
     * @return Label
183
     */
184
    private function createLabel(AbstractLabelCommand $labelCommand)
185
    {
186
        $labelName = new StringLiteral((string) $labelCommand->getLabel());
187
        $label = $this->labelRepository->getByName($labelName);
188
189
        return new Label(
190
            $labelName->toNative(),
191
            $label->getVisibility() === Visibility::VISIBLE()
192
        );
193
    }
194
195
    /**
196
     * @param DeleteOrganizer $deleteOrganizer

src/Offer/OfferCommandHandler.php 1 location

@@ 316-325 (lines=10) @@
313
     * @param AbstractLabelCommand $labelCommand
314
     * @return Label
315
     */
316
    private function createLabel(AbstractLabelCommand $labelCommand)
317
    {
318
        $labelName = new StringLiteral((string) $labelCommand->getLabel());
319
        $label = $this->labelRepository->getByName($labelName);
320
321
        return new Label(
322
            $labelName->toNative(),
323
            $label->getVisibility() === Visibility::VISIBLE()
324
        );
325
    }
326
327
    /**
328
     * @param AbstractUpdateTitle $translateTitle