Skip to content

Commit

Permalink
refactor getDatabasePlatform call
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaicher committed Oct 30, 2023
1 parent ad85762 commit 843e348
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions ConnectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,9 @@ public function createConnection(array $params, ?Configuration $config = null, ?
$connection = DriverManager::getConnection(...array_merge([$params, $config], $eventManager ? [$eventManager] : []));
$params = $this->addDatabaseSuffix(array_merge($connection->getParams(), $overriddenOptions));
$driver = $connection->getDriver();
if (class_exists(StaticServerVersionProvider::class)) {
$platform = $driver->getDatabasePlatform(new StaticServerVersionProvider($params['serverVersion'] ?? ''));
} else {
$platform = $driver->getDatabasePlatform();
}
$platform = $driver->getDatabasePlatform(
...(class_exists(StaticServerVersionProvider::class) ? [new StaticServerVersionProvider($params['serverVersion'] ?? '')] : [])
);

if (! isset($params['charset'])) {
if ($platform instanceof AbstractMySQLPlatform) {
Expand Down

0 comments on commit 843e348

Please sign in to comment.