Code Duplication    Length = 22-23 lines in 2 locations

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

@@ 235-256 (lines=22) @@
232
    /**
233
     * {@inheritdoc}
234
     */
235
    public function getVersionLog()
236
    {
237
        $result = [];
238
239
        switch ($this->options['version_order']) {
240
            case \Phinx\Config\Config::VERSION_ORDER_CREATION_TIME:
241
                $orderBy = 'version ASC';
242
                break;
243
            case \Phinx\Config\Config::VERSION_ORDER_EXECUTION_TIME:
244
                $orderBy = 'start_time ASC, version ASC';
245
                break;
246
            default:
247
                throw new \RuntimeException('Invalid version_order configuration option');
248
        }
249
250
        $rows = $this->fetchAll(sprintf('SELECT * FROM %s ORDER BY %s', $this->getSchemaTableName(), $orderBy));
251
        foreach ($rows as $version) {
252
            $result[$version['version']] = $version;
253
        }
254
255
        return $result;
256
    }
257
258
    /**
259
     * {@inheritdoc}

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