Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 1739-1750 (lines=12) @@
1736
1737
        /** @var $relations \eZ\Publish\API\Repository\Values\Content\Relation[] */
1738
        $relations = array();
1739
        foreach ($spiRelations as $spiRelation) {
1740
            $destinationContentInfo = $this->internalLoadContentInfo($spiRelation->destinationContentId);
1741
            if (!$this->repository->canUser('content', 'read', $destinationContentInfo)) {
1742
                continue;
1743
            }
1744
1745
            $relations[] = $this->domainMapper->buildRelationDomainObject(
1746
                $spiRelation,
1747
                $contentInfo,
1748
                $destinationContentInfo
1749
            );
1750
        }
1751
1752
        return $relations;
1753
    }
@@ 1777-1788 (lines=12) @@
1774
        );
1775
1776
        $returnArray = array();
1777
        foreach ($spiRelations as $spiRelation) {
1778
            $sourceContentInfo = $this->internalLoadContentInfo($spiRelation->sourceContentId);
1779
            if (!$this->repository->canUser('content', 'read', $sourceContentInfo)) {
1780
                continue;
1781
            }
1782
1783
            $returnArray[] = $this->domainMapper->buildRelationDomainObject(
1784
                $spiRelation,
1785
                $sourceContentInfo,
1786
                $contentInfo
1787
            );
1788
        }
1789
1790
        return $returnArray;
1791
    }