Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 1689-1700 (lines=12) @@
1686
1687
        /** @var $relations \eZ\Publish\API\Repository\Values\Content\Relation[] */
1688
        $relations = array();
1689
        foreach ($spiRelations as $spiRelation) {
1690
            $destinationContentInfo = $this->internalLoadContentInfo($spiRelation->destinationContentId);
1691
            if (!$this->repository->canUser('content', 'read', $destinationContentInfo)) {
1692
                continue;
1693
            }
1694
1695
            $relations[] = $this->domainMapper->buildRelationDomainObject(
1696
                $spiRelation,
1697
                $contentInfo,
1698
                $destinationContentInfo
1699
            );
1700
        }
1701
1702
        return $relations;
1703
    }
@@ 1727-1738 (lines=12) @@
1724
        );
1725
1726
        $returnArray = array();
1727
        foreach ($spiRelations as $spiRelation) {
1728
            $sourceContentInfo = $this->internalLoadContentInfo($spiRelation->sourceContentId);
1729
            if (!$this->repository->canUser('content', 'read', $sourceContentInfo)) {
1730
                continue;
1731
            }
1732
1733
            $returnArray[] = $this->domainMapper->buildRelationDomainObject(
1734
                $spiRelation,
1735
                $sourceContentInfo,
1736
                $contentInfo
1737
            );
1738
        }
1739
1740
        return $returnArray;
1741
    }