Code Duplication    Length = 12-12 lines in 2 locations

src/Phinx/Db/Adapter/PdoAdapter.php 1 location

@@ 497-508 (lines=12) @@
494
     * @param string $columnType column type added
495
     * @return string
496
     */
497
    protected function getDefaultValueDefinition($default, $columnType = null)
498
    {
499
        if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) {
500
            $default = $this->getConnection()->quote($default);
501
        } elseif (is_bool($default)) {
502
            $default = $this->castToBool($default);
503
        } elseif ($default !== null && $columnType === static::PHINX_TYPE_BOOLEAN) {
504
            $default = $this->castToBool((bool)$default);
505
        }
506
507
        return isset($default) ? " DEFAULT $default" : '';
508
    }
509
510
    /**
511
     * Executes all the ALTER TABLE instructions passed for the given table

src/Phinx/Db/Adapter/PostgresAdapter.php 1 location

@@ 1080-1091 (lines=12) @@
1077
     * @param string $columnType column type added
1078
     * @return string
1079
     */
1080
    protected function getDefaultValueDefinition($default, $columnType = null)
1081
    {
1082
        if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) {
1083
            $default = $this->getConnection()->quote($default);
1084
        } elseif (is_bool($default)) {
1085
            $default = $this->castToBool($default);
1086
        } elseif ($columnType === static::PHINX_TYPE_BOOLEAN) {
1087
            $default = $this->castToBool((bool)$default);
1088
        }
1089
1090
        return isset($default) ? 'DEFAULT ' . $default : '';
1091
    }
1092
1093
    /**
1094
     * Gets the PostgreSQL Column Definition for a Column object.