Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 1746-1757 (lines=12) @@
1743
1744
        /** @var $relations \eZ\Publish\API\Repository\Values\Content\Relation[] */
1745
        $relations = array();
1746
        foreach ($spiRelations as $spiRelation) {
1747
            $destinationContentInfo = $this->internalLoadContentInfo($spiRelation->destinationContentId);
1748
            if (!$this->repository->canUser('content', 'read', $destinationContentInfo)) {
1749
                continue;
1750
            }
1751
1752
            $relations[] = $this->domainMapper->buildRelationDomainObject(
1753
                $spiRelation,
1754
                $contentInfo,
1755
                $destinationContentInfo
1756
            );
1757
        }
1758
1759
        return $relations;
1760
    }
@@ 1784-1795 (lines=12) @@
1781
        );
1782
1783
        $returnArray = array();
1784
        foreach ($spiRelations as $spiRelation) {
1785
            $sourceContentInfo = $this->internalLoadContentInfo($spiRelation->sourceContentId);
1786
            if (!$this->repository->canUser('content', 'read', $sourceContentInfo)) {
1787
                continue;
1788
            }
1789
1790
            $returnArray[] = $this->domainMapper->buildRelationDomainObject(
1791
                $spiRelation,
1792
                $sourceContentInfo,
1793
                $contentInfo
1794
            );
1795
        }
1796
1797
        return $returnArray;
1798
    }