Code Duplication    Length = 19-20 lines in 3 locations

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

@@ 1405-1424 (lines=20) @@
1402
     * {@inheritDoc}
1403
     *
1404
     */
1405
    public function getDecoratedConnection()
1406
    {
1407
        $options = $this->getOptions();
1408
        $options = [
1409
            'username' => $options['user'],
1410
            'password' => $options['pass'],
1411
            'database' => $options['name'],
1412
            'quoteIdentifiers' => true,
1413
        ] + $options;
1414
1415
        $driver = new PostgresDriver($options);
1416
1417
        if (method_exists($driver, 'setConnection')) {
1418
            $driver->setConnection($this->connection);
1419
        } else {
1420
            $driver->connection($this->connection);
1421
        }
1422
1423
        return new Connection(['driver' => $driver] + $options);
1424
    }
1425
}
1426

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

@@ 1254-1273 (lines=20) @@
1251
     * {@inheritDoc}
1252
     *
1253
     */
1254
    public function getDecoratedConnection()
1255
    {
1256
        $options = $this->getOptions();
1257
        $options = [
1258
            'username' => $options['user'],
1259
            'password' => $options['pass'],
1260
            'database' => $options['name'],
1261
            'quoteIdentifiers' => true,
1262
        ] + $options;
1263
1264
        $driver = new SqlServerDriver($options);
1265
1266
        if (method_exists($driver, 'setConnection')) {
1267
            $driver->setConnection($this->connection);
1268
        } else {
1269
            $driver->connection($this->connection);
1270
        }
1271
1272
        return new Connection(['driver' => $driver] + $options);
1273
    }
1274
}
1275

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

@@ 1252-1270 (lines=19) @@
1249
     * {@inheritDoc}
1250
     *
1251
     */
1252
    public function getDecoratedConnection()
1253
    {
1254
        $options = $this->getOptions();
1255
        $options = [
1256
            'username' => $options['user'],
1257
            'password' => $options['pass'],
1258
            'database' => $options['name'],
1259
            'quoteIdentifiers' => true,
1260
        ] + $options;
1261
1262
        $driver = new MysqlDriver($options);
1263
        if (method_exists($driver, 'setConnection')) {
1264
            $driver->setConnection($this->connection);
1265
        } else {
1266
            $driver->connection($this->connection);
1267
        }
1268
1269
        return new Connection(['driver' => $driver] + $options);
1270
    }
1271
}
1272