Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 1723-1734 (lines=12) @@
1720
1721
        /** @var $relations \eZ\Publish\API\Repository\Values\Content\Relation[] */
1722
        $relations = array();
1723
        foreach ($spiRelations as $spiRelation) {
1724
            $destinationContentInfo = $this->internalLoadContentInfo($spiRelation->destinationContentId);
1725
            if (!$this->repository->canUser('content', 'read', $destinationContentInfo)) {
1726
                continue;
1727
            }
1728
1729
            $relations[] = $this->domainMapper->buildRelationDomainObject(
1730
                $spiRelation,
1731
                $contentInfo,
1732
                $destinationContentInfo
1733
            );
1734
        }
1735
1736
        return $relations;
1737
    }
@@ 1761-1772 (lines=12) @@
1758
        );
1759
1760
        $returnArray = array();
1761
        foreach ($spiRelations as $spiRelation) {
1762
            $sourceContentInfo = $this->internalLoadContentInfo($spiRelation->sourceContentId);
1763
            if (!$this->repository->canUser('content', 'read', $sourceContentInfo)) {
1764
                continue;
1765
            }
1766
1767
            $returnArray[] = $this->domainMapper->buildRelationDomainObject(
1768
                $spiRelation,
1769
                $sourceContentInfo,
1770
                $contentInfo
1771
            );
1772
        }
1773
1774
        return $returnArray;
1775
    }