diff --git a/system/Database/Config.php b/system/Database/Config.php index 899e214cc284..b9d4198790bd 100644 --- a/system/Database/Config.php +++ b/system/Database/Config.php @@ -61,9 +61,7 @@ public static function connect($group = null, bool $getShared = true) } else { $dbConfig = config(DbConfig::class); - if ($group === null) { - $group = service('environment')->isTesting() ? 'tests' : $dbConfig->defaultGroup; - } + $group ??= service('environment')->isTesting() ? 'tests' : $dbConfig->defaultGroup; assert(is_string($group));