Code Duplication    Length = 19-20 lines in 3 locations

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

@@ 1132-1150 (lines=19) @@
1129
     * {@inheritDoc}
1130
     *
1131
     */
1132
    public function getDecoratedConnection()
1133
    {
1134
        $options = $this->getOptions();
1135
        $options = [
1136
            'username' => $options['user'],
1137
            'password' => $options['pass'],
1138
            'database' => $options['name'],
1139
            'quoteIdentifiers' => true,
1140
        ] + $options;
1141
1142
        $driver = new MysqlDriver($options);
1143
        if (method_exists($driver, 'setConnection')) {
1144
            $driver->setConnection($this->connection);
1145
        } else {
1146
            $driver->connection($this->connection);
1147
        }
1148
1149
        return new Connection(['driver' => $driver] + $options);
1150
    }
1151
}
1152

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

@@ 1150-1169 (lines=20) @@
1147
     * {@inheritDoc}
1148
     *
1149
     */
1150
    public function getDecoratedConnection()
1151
    {
1152
        $options = $this->getOptions();
1153
        $options = [
1154
            'username' => $options['user'],
1155
            'password' => $options['pass'],
1156
            'database' => $options['name'],
1157
            'quoteIdentifiers' => true,
1158
        ] + $options;
1159
1160
        $driver = new SqlServerDriver($options);
1161
1162
        if (method_exists($driver, 'setConnection')) {
1163
            $driver->setConnection($this->connection);
1164
        } else {
1165
            $driver->connection($this->connection);
1166
        }
1167
1168
        return new Connection(['driver' => $driver] + $options);
1169
    }
1170
}
1171

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

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