Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 1665-1676 (lines=12) @@
1662
1663
        /** @var $relations \eZ\Publish\API\Repository\Values\Content\Relation[] */
1664
        $relations = array();
1665
        foreach ($spiRelations as $spiRelation) {
1666
            $destinationContentInfo = $this->internalLoadContentInfo($spiRelation->destinationContentId);
1667
            if (!$this->repository->canUser('content', 'read', $destinationContentInfo)) {
1668
                continue;
1669
            }
1670
1671
            $relations[] = $this->domainMapper->buildRelationDomainObject(
1672
                $spiRelation,
1673
                $contentInfo,
1674
                $destinationContentInfo
1675
            );
1676
        }
1677
1678
        return $relations;
1679
    }
@@ 1703-1714 (lines=12) @@
1700
        );
1701
1702
        $returnArray = array();
1703
        foreach ($spiRelations as $spiRelation) {
1704
            $sourceContentInfo = $this->internalLoadContentInfo($spiRelation->sourceContentId);
1705
            if (!$this->repository->canUser('content', 'read', $sourceContentInfo)) {
1706
                continue;
1707
            }
1708
1709
            $returnArray[] = $this->domainMapper->buildRelationDomainObject(
1710
                $spiRelation,
1711
                $sourceContentInfo,
1712
                $contentInfo
1713
            );
1714
        }
1715
1716
        return $returnArray;
1717
    }