Code Duplication    Length = 6-10 lines in 3 locations

Controllers/Frontend/PaymentKlarna.php 3 locations

@@ 236-241 (lines=6) @@
233
            if (!empty($session->sUserId)) {
234
                if ($order !== null) {
235
                    $module->sSYSTEM->_POST = $data['shipping'];
236
                    if (Shopware::VERSION === '___VERSION___' || version_compare(Shopware::VERSION, '5.2.0', '>=')) {
237
                        $userId = $session->offsetGet('sUserId');
238
                        $this->updateShipping($userId, $data['shipping']);
239
                    } else {
240
                        $module->sUpdateShipping();
241
                    }
242
                    $module->sSYSTEM->_POST = $data['billing'];
243
                    if (Shopware::VERSION === '___VERSION___' || version_compare(Shopware::VERSION, '5.2.0', '>=')) {                
244
                         $userId = $session->offsetGet('sUserId');
@@ 243-248 (lines=6) @@
240
                        $module->sUpdateShipping();
241
                    }
242
                    $module->sSYSTEM->_POST = $data['billing'];
243
                    if (Shopware::VERSION === '___VERSION___' || version_compare(Shopware::VERSION, '5.2.0', '>=')) {                
244
                         $userId = $session->offsetGet('sUserId');
245
                         $this->updateBilling($userId, $data['billing']);
246
                    } else{
247
                        $module->sUpdateBilling();
248
                    }
249
                    unset($data['auth']['password']);
250
                    $module->sSYSTEM->_POST = $data['auth'];
251
                    if (Shopware::VERSION === '___VERSION___' || version_compare(Shopware::VERSION, '5.2.0', '>=')) {
@@ 268-277 (lines=10) @@
265
                        'SELECT id FROM s_user_shippingaddress WHERE userID = ?',
266
                        array($session->offsetGet('sUserId'))
267
                    );
268
                    if (!empty($shippingId)) {
269
                        if (Shopware::VERSION === '___VERSION___' || version_compare(Shopware::VERSION, '5.2.0', '>=')) {
270
                            $userId = $session->offsetGet('sUserId');
271
                            $this->updateShipping($userId, $data['shipping']);
272
                        } else {
273
                            $module->sUpdateShipping();
274
                        }
275
                    } else {
276
                        $module->sUpdateBilling();
277
                    }
278
                }
279
                $module->sSYSTEM->_POST = array('sPayment' => $paymentId);
280
                $module->sUpdatePayment();