Code Duplication    Length = 12-12 lines in 2 locations

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

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