Code Duplication    Length = 17-17 lines in 2 locations

eZ/Publish/Core/REST/Server/Controller/Content.php 2 locations

@@ 346-362 (lines=17) @@
343
     *
344
     * @return \eZ\Publish\Core\REST\Server\Values\NoContent
345
     */
346
    public function deleteContentVersion($contentId, $versionNumber)
347
    {
348
        $versionInfo = $this->repository->getContentService()->loadVersionInfo(
349
            $this->repository->getContentService()->loadContentInfo($contentId),
350
            $versionNumber
351
        );
352
353
        if ($versionInfo->isPublished()) {
354
            throw new ForbiddenException('Version in status PUBLISHED cannot be deleted');
355
        }
356
357
        $this->repository->getContentService()->deleteVersion(
358
            $versionInfo
359
        );
360
361
        return new Values\NoContent();
362
    }
363
364
    /**
365
     * Remove the given Translation from the given Version Draft.
@@ 530-546 (lines=17) @@
527
     *
528
     * @return \eZ\Publish\Core\REST\Server\Values\NoContent
529
     */
530
    public function publishVersion($contentId, $versionNumber)
531
    {
532
        $versionInfo = $this->repository->getContentService()->loadVersionInfo(
533
            $this->repository->getContentService()->loadContentInfo($contentId),
534
            $versionNumber
535
        );
536
537
        if (!$versionInfo->isDraft()) {
538
            throw new ForbiddenException('Only version in status DRAFT can be published');
539
        }
540
541
        $this->repository->getContentService()->publishVersion(
542
            $versionInfo
543
        );
544
545
        return new Values\NoContent();
546
    }
547
548
    /**
549
     * Redirects to the relations of the current version.