Code Duplication    Length = 17-17 lines in 2 locations

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

@@ 519-535 (lines=17) @@
516
     *
517
     * @return \eZ\Publish\API\Repository\Values\Content\Location $location, with updated hidden value
518
     */
519
    public function hideLocation(APILocation $location)
520
    {
521
        if (!$this->repository->canUser('content', 'hide', $location->getContentInfo(), $location)) {
522
            throw new UnauthorizedException('content', 'hide');
523
        }
524
525
        $this->repository->beginTransaction();
526
        try {
527
            $this->persistenceHandler->locationHandler()->hide($location->id);
528
            $this->repository->commit();
529
        } catch (Exception $e) {
530
            $this->repository->rollback();
531
            throw $e;
532
        }
533
534
        return $this->loadLocation($location->id);
535
    }
536
537
    /**
538
     * Unhides the $location.
@@ 549-565 (lines=17) @@
546
     *
547
     * @return \eZ\Publish\API\Repository\Values\Content\Location $location, with updated hidden value
548
     */
549
    public function unhideLocation(APILocation $location)
550
    {
551
        if (!$this->repository->canUser('content', 'hide', $location->getContentInfo(), $location)) {
552
            throw new UnauthorizedException('content', 'hide');
553
        }
554
555
        $this->repository->beginTransaction();
556
        try {
557
            $this->persistenceHandler->locationHandler()->unHide($location->id);
558
            $this->repository->commit();
559
        } catch (Exception $e) {
560
            $this->repository->rollback();
561
            throw $e;
562
        }
563
564
        return $this->loadLocation($location->id);
565
    }
566
567
    /**
568
     * Moves the subtree to $newParentLocation.