Code Duplication    Length = 29-29 lines in 2 locations

src/database/Postgres.php 2 locations

@@ 2460-2488 (lines=29) @@
2457
                $first = false;
2458
            }
2459
2460
            switch ($type[$i]) {
2461
                // Have to account for weird placing of length for with/without
2462
                // time zone types
2463
                case 'timestamp with time zone':
2464
                case 'timestamp without time zone':
2465
                    $qual = substr($type[$i], 9);
2466
                    $sql .= "\"{$field[$i]}\" timestamp";
2467
                    if ($length[$i] != '') {
2468
                        $sql .= "({$length[$i]})";
2469
                    }
2470
2471
                    $sql .= $qual;
2472
                    break;
2473
                case 'time with time zone':
2474
                case 'time without time zone':
2475
                    $qual = substr($type[$i], 4);
2476
                    $sql .= "\"{$field[$i]}\" time";
2477
                    if ($length[$i] != '') {
2478
                        $sql .= "({$length[$i]})";
2479
                    }
2480
2481
                    $sql .= $qual;
2482
                    break;
2483
                default:
2484
                    $sql .= "\"{$field[$i]}\" {$type[$i]}";
2485
                    if ($length[$i] != '') {
2486
                        $sql .= "({$length[$i]})";
2487
                    }
2488
            }
2489
            // Add array qualifier if necessary
2490
            if ($array[$i] == '[]') {
2491
                $sql .= '[]';
@@ 6018-6046 (lines=29) @@
6015
                $first = false;
6016
            }
6017
6018
            switch ($type[$i]) {
6019
                // Have to account for weird placing of length for with/without
6020
                // time zone types
6021
                case 'timestamp with time zone':
6022
                case 'timestamp without time zone':
6023
                    $qual = substr($type[$i], 9);
6024
                    $sql .= "\"{$field[$i]}\" timestamp";
6025
                    if ($length[$i] != '') {
6026
                        $sql .= "({$length[$i]})";
6027
                    }
6028
6029
                    $sql .= $qual;
6030
                    break;
6031
                case 'time with time zone':
6032
                case 'time without time zone':
6033
                    $qual = substr($type[$i], 4);
6034
                    $sql .= "\"{$field[$i]}\" time";
6035
                    if ($length[$i] != '') {
6036
                        $sql .= "({$length[$i]})";
6037
                    }
6038
6039
                    $sql .= $qual;
6040
                    break;
6041
                default:
6042
                    $sql .= "\"{$field[$i]}\" {$type[$i]}";
6043
                    if ($length[$i] != '') {
6044
                        $sql .= "({$length[$i]})";
6045
                    }
6046
            }
6047
            // Add array qualifier if necessary
6048
            if ($array[$i] == '[]') {
6049
                $sql .= '[]';