Code Duplication    Length = 12-12 lines in 2 locations

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

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