Code Duplication    Length = 18-18 lines in 2 locations

Bootstrap/Update.php 2 locations

@@ 420-437 (lines=18) @@
417
    /**
418
     * Create most used indexes in s_plugin_connect_items table.
419
     */
420
    private function addConnectItemsIndex()
421
    {
422
        if (version_compare($this->version, '1.1.1', '<=')) {
423
            try {
424
                $this->db->query('ALTER TABLE s_plugin_connect_items ADD INDEX stream(shop_id, stream)');
425
                $this->db->query('ALTER TABLE s_plugin_connect_items MODIFY group_id VARCHAR(64)');
426
                $this->db->query('ALTER TABLE s_plugin_connect_items ADD INDEX source_id (source_id, shop_id)');
427
                $this->db->query('ALTER TABLE s_plugin_connect_items ADD INDEX group_id (group_id, shop_id)');
428
            } catch (\Exception $e) {
429
                // ignore it if exists
430
                $this->logger->write(
431
                    true,
432
                    sprintf('An error occurred during update to version %s stacktrace: %s', $this->version, $e->getTraceAsString()),
433
                    $e->getMessage()
434
                );
435
            }
436
        }
437
    }
438
439
    /**
440
     * Create the mapping table between connect remote categories and local categories.
@@ 528-545 (lines=18) @@
525
        }
526
    }
527
528
    private function addShopIdToConnectCategories()
529
    {
530
        if (version_compare($this->version, '1.1.7', '<=')) {
531
            try {
532
                $this->db->query('INSERT INTO `s_plugin_connect_config` (`name`, `value`) VALUES ("addShopIdToConnectCategories", "0")');
533
                $this->db->query('ALTER TABLE s_plugin_connect_categories ADD COLUMN `shop_id` int(11) NULL');
534
                $this->db->query('ALTER TABLE s_plugin_connect_categories DROP INDEX scuk_category_key');
535
                $this->db->query('ALTER TABLE s_plugin_connect_categories ADD UNIQUE KEY `scuk_connect_category_for_shop_id` (`category_key`,`shop_id`)');
536
            } catch (\Exception $e) {
537
                // ignore it if exists
538
                $this->logger->write(
539
                    true,
540
                    sprintf('An error occurred during update to version %s stacktrace: %s', $this->version, $e->getTraceAsString()),
541
                    $e->getMessage()
542
                );
543
            }
544
        }
545
    }
546
547
    private function addStreamColumnToConnectToLocalCategories()
548
    {