Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 1818-1829 (lines=12) @@
1815
1816
        /** @var $relations \eZ\Publish\API\Repository\Values\Content\Relation[] */
1817
        $relations = array();
1818
        foreach ($spiRelations as $spiRelation) {
1819
            $destinationContentInfo = $this->internalLoadContentInfo($spiRelation->destinationContentId);
1820
            if (!$this->repository->canUser('content', 'read', $destinationContentInfo)) {
1821
                continue;
1822
            }
1823
1824
            $relations[] = $this->domainMapper->buildRelationDomainObject(
1825
                $spiRelation,
1826
                $contentInfo,
1827
                $destinationContentInfo
1828
            );
1829
        }
1830
1831
        return $relations;
1832
    }
@@ 1856-1867 (lines=12) @@
1853
        );
1854
1855
        $returnArray = array();
1856
        foreach ($spiRelations as $spiRelation) {
1857
            $sourceContentInfo = $this->internalLoadContentInfo($spiRelation->sourceContentId);
1858
            if (!$this->repository->canUser('content', 'read', $sourceContentInfo)) {
1859
                continue;
1860
            }
1861
1862
            $returnArray[] = $this->domainMapper->buildRelationDomainObject(
1863
                $spiRelation,
1864
                $sourceContentInfo,
1865
                $contentInfo
1866
            );
1867
        }
1868
1869
        return $returnArray;
1870
    }