Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 1731-1742 (lines=12) @@
1728
1729
        /** @var $relations \eZ\Publish\API\Repository\Values\Content\Relation[] */
1730
        $relations = array();
1731
        foreach ($spiRelations as $spiRelation) {
1732
            $destinationContentInfo = $this->internalLoadContentInfo($spiRelation->destinationContentId);
1733
            if (!$this->repository->canUser('content', 'read', $destinationContentInfo)) {
1734
                continue;
1735
            }
1736
1737
            $relations[] = $this->domainMapper->buildRelationDomainObject(
1738
                $spiRelation,
1739
                $contentInfo,
1740
                $destinationContentInfo
1741
            );
1742
        }
1743
1744
        return $relations;
1745
    }
@@ 1769-1780 (lines=12) @@
1766
        );
1767
1768
        $returnArray = array();
1769
        foreach ($spiRelations as $spiRelation) {
1770
            $sourceContentInfo = $this->internalLoadContentInfo($spiRelation->sourceContentId);
1771
            if (!$this->repository->canUser('content', 'read', $sourceContentInfo)) {
1772
                continue;
1773
            }
1774
1775
            $returnArray[] = $this->domainMapper->buildRelationDomainObject(
1776
                $spiRelation,
1777
                $sourceContentInfo,
1778
                $contentInfo
1779
            );
1780
        }
1781
1782
        return $returnArray;
1783
    }