Code Duplication    Length = 14-14 lines in 2 locations

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

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

src/Oro/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