Code Duplication    Length = 19-20 lines in 3 locations

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

@@ 1429-1448 (lines=20) @@
1426
     * {@inheritDoc}
1427
     *
1428
     */
1429
    public function getDecoratedConnection()
1430
    {
1431
        $options = $this->getOptions();
1432
        $options = [
1433
            'username' => $options['user'],
1434
            'password' => $options['pass'],
1435
            'database' => $options['name'],
1436
            'quoteIdentifiers' => true,
1437
        ] + $options;
1438
1439
        $driver = new PostgresDriver($options);
1440
1441
        if (method_exists($driver, 'setConnection')) {
1442
            $driver->setConnection($this->connection);
1443
        } else {
1444
            $driver->connection($this->connection);
1445
        }
1446
1447
        return new Connection(['driver' => $driver] + $options);
1448
    }
1449
}
1450

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

@@ 1277-1296 (lines=20) @@
1274
     * {@inheritDoc}
1275
     *
1276
     */
1277
    public function getDecoratedConnection()
1278
    {
1279
        $options = $this->getOptions();
1280
        $options = [
1281
            'username' => $options['user'],
1282
            'password' => $options['pass'],
1283
            'database' => $options['name'],
1284
            'quoteIdentifiers' => true,
1285
        ] + $options;
1286
1287
        $driver = new SqlServerDriver($options);
1288
1289
        if (method_exists($driver, 'setConnection')) {
1290
            $driver->setConnection($this->connection);
1291
        } else {
1292
            $driver->connection($this->connection);
1293
        }
1294
1295
        return new Connection(['driver' => $driver] + $options);
1296
    }
1297
}
1298

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

@@ 1299-1317 (lines=19) @@
1296
     * {@inheritDoc}
1297
     *
1298
     */
1299
    public function getDecoratedConnection()
1300
    {
1301
        $options = $this->getOptions();
1302
        $options = [
1303
            'username' => $options['user'],
1304
            'password' => $options['pass'],
1305
            'database' => $options['name'],
1306
            'quoteIdentifiers' => true,
1307
        ] + $options;
1308
1309
        $driver = new MysqlDriver($options);
1310
        if (method_exists($driver, 'setConnection')) {
1311
            $driver->setConnection($this->connection);
1312
        } else {
1313
            $driver->connection($this->connection);
1314
        }
1315
1316
        return new Connection(['driver' => $driver] + $options);
1317
    }
1318
}
1319