Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 1090-1101 (lines=12) @@
1087
     * @param string $columnType column type added
1088
     * @return string
1089
     */
1090
    protected function getDefaultValueDefinition($default, $columnType = null)
1091
    {
1092
        if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) {
1093
            $default = $this->getConnection()->quote($default);
1094
        } elseif (is_bool($default)) {
1095
            $default = $this->castToBool($default);
1096
        } elseif ($columnType === static::PHINX_TYPE_BOOLEAN) {
1097
            $default = $this->castToBool((bool)$default);
1098
        }
1099
1100
        return isset($default) ? 'DEFAULT ' . $default : '';
1101
    }
1102
1103
    /**
1104
     * Gets the PostgreSQL Column Definition for a Column object.

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

@@ 575-586 (lines=12) @@
572
     * @param string $columnType column type added
573
     * @return string
574
     */
575
    protected function getDefaultValueDefinition($default, $columnType = null)
576
    {
577
        if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) {
578
            $default = $this->getConnection()->quote($default);
579
        } elseif (is_bool($default)) {
580
            $default = $this->castToBool($default);
581
        } elseif ($default !== null && $columnType === static::PHINX_TYPE_BOOLEAN) {
582
            $default = $this->castToBool((bool)$default);
583
        }
584
585
        return isset($default) ? " DEFAULT $default" : '';
586
    }
587
588
    /**
589
     * Executes all the ALTER TABLE instructions passed for the given table