Code Duplication    Length = 3-8 lines in 2 locations

src/OroCRM/Bundle/MagentoBundle/ImportExport/Strategy/CartStrategy.php 1 location

@@ 309-316 (lines=8) @@
306
        if ($entity instanceof Region) {
307
            /** @var \OroCRM\Bundle\MagentoBundle\Entity\Region $existingEntity */
308
            $existingEntity = $this->findRegionEntity($entity);
309
        } elseif ($entity instanceof Customer && !$entity->getOriginId() && $this->existingEntity) {
310
            /**
311
             * Get existing customer entity
312
             * As guest customer entity not exist in Magento as separate entity and saved in order
313
             * find guest by customer email
314
             */
315
            $existingEntity = $this->findExistingCustomerByContext($this->existingEntity);
316
        } else {
317
            $existingEntity = parent::findExistingEntity($entity, $searchContext);
318
        }
319

src/OroCRM/Bundle/MagentoBundle/ImportExport/Strategy/OrderWithExistingCustomerStrategy.php 1 location

@@ 111-113 (lines=3) @@
108
     */
109
    protected function findExistingEntity($entity, array $searchContext = [])
110
    {
111
        if ($entity instanceof Customer && !$entity->getOriginId() && $this->existingEntity) {
112
            return $this->findExistingCustomerByContext($this->existingEntity);
113
        }
114
115
        return parent::findExistingEntity($entity, $searchContext);
116
    }