Code Duplication    Length = 29-29 lines in 2 locations

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

@@ 263-291 (lines=29) @@
260
     */
261
    public function migrated(MigrationInterface $migration, $direction, $startTime, $endTime)
262
    {
263
        if (strcasecmp($direction, MigrationInterface::UP) === 0) {
264
            // up
265
            $sql = sprintf(
266
                "INSERT INTO %s (%s, %s, %s, %s, %s) VALUES ('%s', '%s', '%s', '%s', %s);",
267
                $this->getSchemaTableName(),
268
                $this->quoteColumnName('version'),
269
                $this->quoteColumnName('migration_name'),
270
                $this->quoteColumnName('start_time'),
271
                $this->quoteColumnName('end_time'),
272
                $this->quoteColumnName('breakpoint'),
273
                $migration->getVersion(),
274
                substr($migration->getName(), 0, 100),
275
                $startTime,
276
                $endTime,
277
                $this->castToBool(false)
278
            );
279
280
            $this->execute($sql);
281
        } else {
282
            // down
283
            $sql = sprintf(
284
                "DELETE FROM %s WHERE %s = '%s'",
285
                $this->getSchemaTableName(),
286
                $this->quoteColumnName('version'),
287
                $migration->getVersion()
288
            );
289
290
            $this->execute($sql);
291
        }
292
293
        return $this;
294
    }

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

@@ 1005-1033 (lines=29) @@
1002
        $startTime = "TO_TIMESTAMP('$startTime', 'YYYY-MM-DD HH24:MI:SS')";
1003
        $endTime = "TO_TIMESTAMP('$endTime', 'YYYY-MM-DD HH24:MI:SS')";
1004
1005
        if (strcasecmp($direction, MigrationInterface::UP) === 0) {
1006
            // up
1007
            $sql = sprintf(
1008
                "INSERT INTO \"%s\" (%s, %s, %s, %s, %s) VALUES ('%s', '%s', %s, %s, %s)",
1009
                $this->getSchemaTableName(),
1010
                $this->quoteColumnName('version'),
1011
                $this->quoteColumnName('migration_name'),
1012
                $this->quoteColumnName('start_time'),
1013
                $this->quoteColumnName('end_time'),
1014
                $this->quoteColumnName('breakpoint'),
1015
                $migration->getVersion(),
1016
                substr($migration->getName(), 0, 100),
1017
                $startTime,
1018
                $endTime,
1019
                $this->castToBool(false)
1020
            );
1021
1022
            $this->execute($sql);
1023
        } else {
1024
            // down
1025
            $sql = sprintf(
1026
                "DELETE FROM \"%s\" WHERE %s = '%s'",
1027
                $this->getSchemaTableName(),
1028
                $this->quoteColumnName('version'),
1029
                $migration->getVersion()
1030
            );
1031
1032
            $this->execute($sql);
1033
        }
1034
1035
        return $this;
1036
    }