Code Duplication    Length = 29-29 lines in 2 locations

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

@@ 323-351 (lines=29) @@
320
     */
321
    public function migrated(MigrationInterface $migration, $direction, $startTime, $endTime)
322
    {
323
        if (strcasecmp($direction, MigrationInterface::UP) === 0) {
324
            // up
325
            $sql = sprintf(
326
                "INSERT INTO %s (%s, %s, %s, %s, %s) VALUES ('%s', '%s', '%s', '%s', %s);",
327
                $this->quoteTableName($this->getSchemaTableName()),
328
                $this->quoteColumnName('version'),
329
                $this->quoteColumnName('migration_name'),
330
                $this->quoteColumnName('start_time'),
331
                $this->quoteColumnName('end_time'),
332
                $this->quoteColumnName('breakpoint'),
333
                $migration->getVersion(),
334
                substr($migration->getName(), 0, 100),
335
                $startTime,
336
                $endTime,
337
                $this->castToBool(false)
338
            );
339
340
            $this->execute($sql);
341
        } else {
342
            // down
343
            $sql = sprintf(
344
                "DELETE FROM %s WHERE %s = '%s'",
345
                $this->quoteTableName($this->getSchemaTableName()),
346
                $this->quoteColumnName('version'),
347
                $migration->getVersion()
348
            );
349
350
            $this->execute($sql);
351
        }
352
353
        return $this;
354
    }

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

@@ 990-1018 (lines=29) @@
987
        $startTime = "TO_TIMESTAMP('$startTime', 'YYYY-MM-DD HH24:MI:SS')";
988
        $endTime = "TO_TIMESTAMP('$endTime', 'YYYY-MM-DD HH24:MI:SS')";
989
990
        if (strcasecmp($direction, MigrationInterface::UP) === 0) {
991
            // up
992
            $sql = sprintf(
993
                "INSERT INTO \"%s\" (%s, %s, %s, %s, %s) VALUES ('%s', '%s', %s, %s, %s)",
994
                $this->getSchemaTableName(),
995
                $this->quoteColumnName('version'),
996
                $this->quoteColumnName('migration_name'),
997
                $this->quoteColumnName('start_time'),
998
                $this->quoteColumnName('end_time'),
999
                $this->quoteColumnName('breakpoint'),
1000
                $migration->getVersion(),
1001
                substr($migration->getName(), 0, 100),
1002
                $startTime,
1003
                $endTime,
1004
                $this->castToBool(false)
1005
            );
1006
1007
            $this->execute($sql);
1008
        } else {
1009
            // down
1010
            $sql = sprintf(
1011
                "DELETE FROM \"%s\" WHERE %s = '%s'",
1012
                $this->getSchemaTableName(),
1013
                $this->quoteColumnName('version'),
1014
                $migration->getVersion()
1015
            );
1016
1017
            $this->execute($sql);
1018
        }
1019
1020
        return $this;
1021
    }