Code Duplication    Length = 22-23 lines in 2 locations

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

@@ 1081-1103 (lines=23) @@
1078
    /**
1079
     * {@inheritdoc}
1080
     */
1081
    public function getVersionLog()
1082
    {
1083
        $result = [];
1084
1085
        switch ($this->options['version_order']) {
1086
            case \Phinx\Config\Config::VERSION_ORDER_CREATION_TIME:
1087
                $orderBy = '"version" ASC';
1088
                break;
1089
            case \Phinx\Config\Config::VERSION_ORDER_EXECUTION_TIME:
1090
                $orderBy = '"start_time" ASC, "version" ASC';
1091
                break;
1092
            default:
1093
                throw new \RuntimeException('Invalid version_order configuration option');
1094
        }
1095
1096
        $rows = $this->fetchAll(sprintf('SELECT * FROM %s ORDER BY %s', $this->quoteColumnName(
1097
            $this->getSchemaTableName()
1098
        ), $orderBy));
1099
        foreach ($rows as $version) {
1100
            $result[$version['version']] = $version;
1101
        }
1102
1103
        return $result;
1104
    }
1105
}
1106

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

@@ 295-316 (lines=22) @@
292
    /**
293
     * {@inheritdoc}
294
     */
295
    public function getVersionLog()
296
    {
297
        $result = [];
298
299
        switch ($this->options['version_order']) {
300
            case \Phinx\Config\Config::VERSION_ORDER_CREATION_TIME:
301
                $orderBy = 'version ASC';
302
                break;
303
            case \Phinx\Config\Config::VERSION_ORDER_EXECUTION_TIME:
304
                $orderBy = 'start_time ASC, version ASC';
305
                break;
306
            default:
307
                throw new \RuntimeException('Invalid version_order configuration option');
308
        }
309
310
        $rows = $this->fetchAll(sprintf('SELECT * FROM %s ORDER BY %s', $this->getSchemaTableName(), $orderBy));
311
        foreach ($rows as $version) {
312
            $result[$version['version']] = $version;
313
        }
314
315
        return $result;
316
    }
317
318
    /**
319
     * {@inheritdoc}