Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 959-970 (lines=12) @@
956
     * @param string $columnType column type added
957
     * @return string
958
     */
959
    protected function getDefaultValueDefinition($default, $columnType = null)
960
    {
961
        if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) {
962
            $default = $this->getConnection()->quote($default);
963
        } elseif (is_bool($default)) {
964
            $default = $this->castToBool($default);
965
        } elseif ($columnType === static::PHINX_TYPE_BOOLEAN) {
966
            $default = $this->castToBool((bool)$default);
967
        }
968
969
        return isset($default) ? 'DEFAULT ' . $default : '';
970
    }
971
972
    /**
973
     * Gets the PostgreSQL Column Definition for a Column object.

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

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