Code Duplication    Length = 17-17 lines in 2 locations

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

@@ 561-577 (lines=17) @@
558
     *
559
     * @return \eZ\Publish\API\Repository\Values\Content\Location $location, with updated hidden value
560
     */
561
    public function hideLocation(APILocation $location)
562
    {
563
        if (!$this->repository->canUser('content', 'hide', $location->getContentInfo(), $location)) {
564
            throw new UnauthorizedException('content', 'hide');
565
        }
566
567
        $this->repository->beginTransaction();
568
        try {
569
            $this->persistenceHandler->locationHandler()->hide($location->id);
570
            $this->repository->commit();
571
        } catch (Exception $e) {
572
            $this->repository->rollback();
573
            throw $e;
574
        }
575
576
        return $this->loadLocation($location->id);
577
    }
578
579
    /**
580
     * Unhides the $location.
@@ 591-607 (lines=17) @@
588
     *
589
     * @return \eZ\Publish\API\Repository\Values\Content\Location $location, with updated hidden value
590
     */
591
    public function unhideLocation(APILocation $location)
592
    {
593
        if (!$this->repository->canUser('content', 'hide', $location->getContentInfo(), $location)) {
594
            throw new UnauthorizedException('content', 'hide');
595
        }
596
597
        $this->repository->beginTransaction();
598
        try {
599
            $this->persistenceHandler->locationHandler()->unHide($location->id);
600
            $this->repository->commit();
601
        } catch (Exception $e) {
602
            $this->repository->rollback();
603
            throw $e;
604
        }
605
606
        return $this->loadLocation($location->id);
607
    }
608
609
    /**
610
     * Moves the subtree to $newParentLocation.