Code Duplication    Length = 12-12 lines in 2 locations

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

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