Code Duplication    Length = 22-23 lines in 2 locations

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

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

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}