Code Duplication    Length = 14-14 lines in 2 locations

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

@@ 117-130 (lines=14) @@
114
     *
115
     * @return null|Customer
116
     */
117
    protected function findExistingCustomer($entity)
118
    {
119
        $existingEntity = null;
120
        $customer = $entity->getCustomer();
121
122
        if ($customer->getId() || $customer->getOriginId()) {
123
            $existingEntity = parent::findExistingEntity($customer);
124
        }
125
        if (!$existingEntity) {
126
            $existingEntity = $this->findExistingCustomerByContext($entity);
127
        }
128
129
        return $existingEntity;
130
    }
131
132
    /**
133
     * @param Cart $entity

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

@@ 87-100 (lines=14) @@
84
     *
85
     * @return null|Customer
86
     */
87
    protected function findExistingCustomer(Order $entity)
88
    {
89
        $existingEntity = null;
90
        $customer = $entity->getCustomer();
91
92
        if ($customer->getId() || $customer->getOriginId()) {
93
            $existingEntity = parent::findExistingEntity($customer);
94
        }
95
        if (!$existingEntity) {
96
            $existingEntity = $this->findExistingCustomerByContext($entity);
97
        }
98
99
        return $existingEntity;
100
    }
101
102
    /**
103
     * Get existing customer entity by Identifier or using entity data