Code Duplication    Length = 7-10 lines in 2 locations

eZ/Publish/Core/Repository/ContentService.php 2 locations

@@ 1540-1546 (lines=7) @@
1537
            );
1538
        }
1539
1540
        if (!$this->repository->canUser('content', 'versionremove', $versionInfo)) {
1541
            throw new UnauthorizedException(
1542
                'content',
1543
                'versionremove',
1544
                array('contentId' => $versionInfo->contentInfo->id, 'versionNo' => $versionInfo->versionNo)
1545
            );
1546
        }
1547
1548
        $versionList = $this->persistenceHandler->contentHandler()->listVersions(
1549
            $versionInfo->contentInfo->id,
@@ 1621-1630 (lines=10) @@
1618
        $destinationLocation = $this->repository->getLocationService()->loadLocation(
1619
            $destinationLocationCreateStruct->parentLocationId
1620
        );
1621
        if (!$this->repository->canUser('content', 'create', $contentInfo, [$destinationLocation])) {
1622
            throw new UnauthorizedException(
1623
                'content',
1624
                'create',
1625
                [
1626
                    'parentLocationId' => $destinationLocationCreateStruct->parentLocationId,
1627
                    'sectionId' => $contentInfo->sectionId,
1628
                ]
1629
            );
1630
        }
1631
1632
        $defaultObjectStates = $this->getDefaultObjectStates();
1633