Code Duplication    Length = 7-10 lines in 3 locations

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

@@ 1574-1580 (lines=7) @@
1571
            );
1572
        }
1573
1574
        if (!$this->repository->canUser('content', 'versionremove', $versionInfo)) {
1575
            throw new UnauthorizedException(
1576
                'content',
1577
                'versionremove',
1578
                array('contentId' => $versionInfo->contentInfo->id, 'versionNo' => $versionInfo->versionNo)
1579
            );
1580
        }
1581
1582
        $versionList = $this->persistenceHandler->contentHandler()->listVersions(
1583
            $versionInfo->contentInfo->id,
@@ 1655-1664 (lines=10) @@
1652
        $destinationLocation = $this->repository->getLocationService()->loadLocation(
1653
            $destinationLocationCreateStruct->parentLocationId
1654
        );
1655
        if (!$this->repository->canUser('content', 'create', $contentInfo, [$destinationLocation])) {
1656
            throw new UnauthorizedException(
1657
                'content',
1658
                'create',
1659
                [
1660
                    'parentLocationId' => $destinationLocationCreateStruct->parentLocationId,
1661
                    'sectionId' => $contentInfo->sectionId,
1662
                ]
1663
            );
1664
        }
1665
1666
        $defaultObjectStates = $this->getDefaultObjectStates();
1667
@@ 1944-1950 (lines=7) @@
1941
        $this->repository->beginTransaction();
1942
        try {
1943
            foreach ($this->loadVersions($contentInfo) as $versionInfo) {
1944
                if (!$this->repository->canUser('content', 'remove', $versionInfo)) {
1945
                    throw new UnauthorizedException(
1946
                        'content',
1947
                        'remove',
1948
                        ['contentId' => $contentInfo->id, 'versionNo' => $versionInfo->versionNo]
1949
                    );
1950
                }
1951
1952
                if (!in_array($languageCode, $versionInfo->languageCodes)) {
1953
                    continue;