Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 1663-1674 (lines=12) @@
1660
1661
        /** @var $relations \eZ\Publish\API\Repository\Values\Content\Relation[] */
1662
        $relations = array();
1663
        foreach ($spiRelations as $spiRelation) {
1664
            $destinationContentInfo = $this->internalLoadContentInfo($spiRelation->destinationContentId);
1665
            if (!$this->repository->canUser('content', 'read', $destinationContentInfo)) {
1666
                continue;
1667
            }
1668
1669
            $relations[] = $this->domainMapper->buildRelationDomainObject(
1670
                $spiRelation,
1671
                $contentInfo,
1672
                $destinationContentInfo
1673
            );
1674
        }
1675
1676
        return $relations;
1677
    }
@@ 1701-1712 (lines=12) @@
1698
        );
1699
1700
        $returnArray = array();
1701
        foreach ($spiRelations as $spiRelation) {
1702
            $sourceContentInfo = $this->internalLoadContentInfo($spiRelation->sourceContentId);
1703
            if (!$this->repository->canUser('content', 'read', $sourceContentInfo)) {
1704
                continue;
1705
            }
1706
1707
            $returnArray[] = $this->domainMapper->buildRelationDomainObject(
1708
                $spiRelation,
1709
                $sourceContentInfo,
1710
                $contentInfo
1711
            );
1712
        }
1713
1714
        return $returnArray;
1715
    }