Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 1769-1780 (lines=12) @@
1766
1767
        /** @var $relations \eZ\Publish\API\Repository\Values\Content\Relation[] */
1768
        $relations = array();
1769
        foreach ($spiRelations as $spiRelation) {
1770
            $destinationContentInfo = $this->internalLoadContentInfo($spiRelation->destinationContentId);
1771
            if (!$this->repository->canUser('content', 'read', $destinationContentInfo)) {
1772
                continue;
1773
            }
1774
1775
            $relations[] = $this->domainMapper->buildRelationDomainObject(
1776
                $spiRelation,
1777
                $contentInfo,
1778
                $destinationContentInfo
1779
            );
1780
        }
1781
1782
        return $relations;
1783
    }
@@ 1807-1818 (lines=12) @@
1804
        );
1805
1806
        $returnArray = array();
1807
        foreach ($spiRelations as $spiRelation) {
1808
            $sourceContentInfo = $this->internalLoadContentInfo($spiRelation->sourceContentId);
1809
            if (!$this->repository->canUser('content', 'read', $sourceContentInfo)) {
1810
                continue;
1811
            }
1812
1813
            $returnArray[] = $this->domainMapper->buildRelationDomainObject(
1814
                $spiRelation,
1815
                $sourceContentInfo,
1816
                $contentInfo
1817
            );
1818
        }
1819
1820
        return $returnArray;
1821
    }