Code Duplication    Length = 19-20 lines in 3 locations

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

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

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

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

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

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