Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 1767-1778 (lines=12) @@
1764
1765
        /** @var $relations \eZ\Publish\API\Repository\Values\Content\Relation[] */
1766
        $relations = [];
1767
        foreach ($spiRelations as $spiRelation) {
1768
            $destinationContentInfo = $this->internalLoadContentInfo($spiRelation->destinationContentId);
1769
            if (!$this->repository->canUser('content', 'read', $destinationContentInfo)) {
1770
                continue;
1771
            }
1772
1773
            $relations[] = $this->domainMapper->buildRelationDomainObject(
1774
                $spiRelation,
1775
                $contentInfo,
1776
                $destinationContentInfo
1777
            );
1778
        }
1779
1780
        return $relations;
1781
    }
@@ 1805-1816 (lines=12) @@
1802
        );
1803
1804
        $returnArray = [];
1805
        foreach ($spiRelations as $spiRelation) {
1806
            $sourceContentInfo = $this->internalLoadContentInfo($spiRelation->sourceContentId);
1807
            if (!$this->repository->canUser('content', 'read', $sourceContentInfo)) {
1808
                continue;
1809
            }
1810
1811
            $returnArray[] = $this->domainMapper->buildRelationDomainObject(
1812
                $spiRelation,
1813
                $sourceContentInfo,
1814
                $contentInfo
1815
            );
1816
        }
1817
1818
        return $returnArray;
1819
    }