Code Duplication    Length = 6-10 lines in 3 locations

Controllers/Frontend/PaymentKlarna.php 3 locations

@@ 252-257 (lines=6) @@
249
            if (!empty($session->sUserId)) {
250
                if ($order !== null) {
251
                    $module->sSYSTEM->_POST = $data['shipping'];
252
                    if (Shopware::VERSION === '___VERSION___' || version_compare(Shopware::VERSION, '5.2.0', '>=')) {
253
                        $userId = $session->offsetGet('sUserId');
254
                        $this->updateShipping($userId, $data['shipping']);
255
                    } else {
256
                        $module->sUpdateShipping();
257
                    }
258
                    $module->sSYSTEM->_POST = $data['billing'];
259
                    if (Shopware::VERSION === '___VERSION___' || version_compare(Shopware::VERSION, '5.2.0', '>=')) {                
260
                         $userId = $session->offsetGet('sUserId');
@@ 259-264 (lines=6) @@
256
                        $module->sUpdateShipping();
257
                    }
258
                    $module->sSYSTEM->_POST = $data['billing'];
259
                    if (Shopware::VERSION === '___VERSION___' || version_compare(Shopware::VERSION, '5.2.0', '>=')) {                
260
                         $userId = $session->offsetGet('sUserId');
261
                         $this->updateBilling($userId, $data['billing']);
262
                    } else{
263
                        $module->sUpdateBilling();
264
                    }
265
                    unset($data['auth']['password']);
266
                    $module->sSYSTEM->_POST = $data['auth'];
267
                    if (Shopware::VERSION === '___VERSION___' || version_compare(Shopware::VERSION, '5.2.0', '>=')) {
@@ 284-293 (lines=10) @@
281
                        'SELECT id FROM s_user_shippingaddress WHERE userID = ?',
282
                        array($session->offsetGet('sUserId'))
283
                    );
284
                    if (!empty($shippingId)) {
285
                        if (Shopware::VERSION === '___VERSION___' || version_compare(Shopware::VERSION, '5.2.0', '>=')) {
286
                            $userId = $session->offsetGet('sUserId');
287
                            $this->updateShipping($userId, $data['shipping']);
288
                        } else {
289
                            $module->sUpdateShipping();
290
                        }
291
                    } else {
292
                        $module->sUpdateBilling();
293
                    }
294
                }
295
                $module->sSYSTEM->_POST = array('sPayment' => $paymentId);
296
                $module->sUpdatePayment();