Code Duplication    Length = 12-12 lines in 2 locations

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

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

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

@@ 1113-1124 (lines=12) @@
1110
     * @param string $columnType column type added
1111
     * @return string
1112
     */
1113
    protected function getDefaultValueDefinition($default, $columnType = null)
1114
    {
1115
        if (is_string($default) && 'CURRENT_TIMESTAMP' !== $default) {
1116
            $default = $this->getConnection()->quote($default);
1117
        } elseif (is_bool($default)) {
1118
            $default = $this->castToBool($default);
1119
        } elseif ($columnType === static::PHINX_TYPE_BOOLEAN) {
1120
            $default = $this->castToBool((bool)$default);
1121
        }
1122
1123
        return isset($default) ? 'DEFAULT ' . $default : '';
1124
    }
1125
1126
    /**
1127
     * Gets the PostgreSQL Column Definition for a Column object.