Code Duplication    Length = 7-7 lines in 2 locations

htdocs/class/libraries/vendor/xoops/xmf/src/Xmf/Database/Tables.php 2 locations

@@ 619-625 (lines=7) @@
616
            $tableDef = $this->tables[$table];
617
            $colSql = '';
618
            $valSql = '';
619
            foreach ($tableDef['columns'] as $col) {
620
                $comma = empty($colSql) ? '' : ', ';
621
                if (isset($columns[$col['name']])) {
622
                    $colSql .= $comma . $col['name'];
623
                    $valSql .= $comma . $this->db->quote($columns[$col['name']]);
624
                }
625
            }
626
            $sql = "INSERT INTO `{$tableDef['name']}` ({$colSql}) VALUES({$valSql})";
627
            $this->queue[] = $sql;
628
@@ 655-661 (lines=7) @@
652
                $where = $criteria->renderWhere();
653
            }
654
            $colSql = '';
655
            foreach ($tableDef['columns'] as $col) {
656
                $comma = empty($colSql) ? '' : ', ';
657
                if (isset($columns[$col['name']])) {
658
                    $colSql .= $comma . $col['name'] . ' = '
659
                        . $this->db->quote($columns[$col['name']]);
660
                }
661
            }
662
            $sql = "UPDATE `{$tableDef['name']}` SET {$colSql} {$where}";
663
            $this->queue[] = $sql;
664