Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 1696-1707 (lines=12) @@
1693
1694
        /** @var $relations \eZ\Publish\API\Repository\Values\Content\Relation[] */
1695
        $relations = array();
1696
        foreach ($spiRelations as $spiRelation) {
1697
            $destinationContentInfo = $this->internalLoadContentInfo($spiRelation->destinationContentId);
1698
            if (!$this->repository->canUser('content', 'read', $destinationContentInfo)) {
1699
                continue;
1700
            }
1701
1702
            $relations[] = $this->domainMapper->buildRelationDomainObject(
1703
                $spiRelation,
1704
                $contentInfo,
1705
                $destinationContentInfo
1706
            );
1707
        }
1708
1709
        return $relations;
1710
    }
@@ 1734-1745 (lines=12) @@
1731
        );
1732
1733
        $returnArray = array();
1734
        foreach ($spiRelations as $spiRelation) {
1735
            $sourceContentInfo = $this->internalLoadContentInfo($spiRelation->sourceContentId);
1736
            if (!$this->repository->canUser('content', 'read', $sourceContentInfo)) {
1737
                continue;
1738
            }
1739
1740
            $returnArray[] = $this->domainMapper->buildRelationDomainObject(
1741
                $spiRelation,
1742
                $sourceContentInfo,
1743
                $contentInfo
1744
            );
1745
        }
1746
1747
        return $returnArray;
1748
    }