Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 1740-1751 (lines=12) @@
1737
1738
        /** @var $relations \eZ\Publish\API\Repository\Values\Content\Relation[] */
1739
        $relations = array();
1740
        foreach ($spiRelations as $spiRelation) {
1741
            $destinationContentInfo = $this->internalLoadContentInfo($spiRelation->destinationContentId);
1742
            if (!$this->repository->canUser('content', 'read', $destinationContentInfo)) {
1743
                continue;
1744
            }
1745
1746
            $relations[] = $this->domainMapper->buildRelationDomainObject(
1747
                $spiRelation,
1748
                $contentInfo,
1749
                $destinationContentInfo
1750
            );
1751
        }
1752
1753
        return $relations;
1754
    }
@@ 1778-1789 (lines=12) @@
1775
        );
1776
1777
        $returnArray = array();
1778
        foreach ($spiRelations as $spiRelation) {
1779
            $sourceContentInfo = $this->internalLoadContentInfo($spiRelation->sourceContentId);
1780
            if (!$this->repository->canUser('content', 'read', $sourceContentInfo)) {
1781
                continue;
1782
            }
1783
1784
            $returnArray[] = $this->domainMapper->buildRelationDomainObject(
1785
                $spiRelation,
1786
                $sourceContentInfo,
1787
                $contentInfo
1788
            );
1789
        }
1790
1791
        return $returnArray;
1792
    }