Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 1778-1789 (lines=12) @@
1775
1776
        /** @var $relations \eZ\Publish\API\Repository\Values\Content\Relation[] */
1777
        $relations = array();
1778
        foreach ($spiRelations as $spiRelation) {
1779
            $destinationContentInfo = $this->internalLoadContentInfo($spiRelation->destinationContentId);
1780
            if (!$this->repository->canUser('content', 'read', $destinationContentInfo)) {
1781
                continue;
1782
            }
1783
1784
            $relations[] = $this->domainMapper->buildRelationDomainObject(
1785
                $spiRelation,
1786
                $contentInfo,
1787
                $destinationContentInfo
1788
            );
1789
        }
1790
1791
        return $relations;
1792
    }
@@ 1816-1827 (lines=12) @@
1813
        );
1814
1815
        $returnArray = array();
1816
        foreach ($spiRelations as $spiRelation) {
1817
            $sourceContentInfo = $this->internalLoadContentInfo($spiRelation->sourceContentId);
1818
            if (!$this->repository->canUser('content', 'read', $sourceContentInfo)) {
1819
                continue;
1820
            }
1821
1822
            $returnArray[] = $this->domainMapper->buildRelationDomainObject(
1823
                $spiRelation,
1824
                $sourceContentInfo,
1825
                $contentInfo
1826
            );
1827
        }
1828
1829
        return $returnArray;
1830
    }