Code Duplication    Length = 10-10 lines in 2 locations

src/Organizer/OrganizerCommandHandler.php 1 location

@@ 171-180 (lines=10) @@
168
     * @param AbstractLabelCommand $labelCommand
169
     * @return Label
170
     */
171
    private function createLabel(AbstractLabelCommand $labelCommand)
172
    {
173
        $labelName = new StringLiteral((string) $labelCommand->getLabel());
174
        $label = $this->labelRepository->getByName($labelName);
175
176
        return new Label(
177
            $labelName->toNative(),
178
            $label->getVisibility() === Visibility::VISIBLE()
179
        );
180
    }
181
182
    /**
183
     * @param DeleteOrganizer $deleteOrganizer

src/Offer/OfferCommandHandler.php 1 location

@@ 300-309 (lines=10) @@
297
     * @param AbstractLabelCommand $labelCommand
298
     * @return Label
299
     */
300
    private function createLabel(AbstractLabelCommand $labelCommand)
301
    {
302
        $labelName = new StringLiteral((string) $labelCommand->getLabel());
303
        $label = $this->labelRepository->getByName($labelName);
304
305
        return new Label(
306
            $labelName->toNative(),
307
            $label->getVisibility() === Visibility::VISIBLE()
308
        );
309
    }
310
311
    /**
312
     * @param AbstractUpdateTitle $translateTitle