We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2456f67 commit ef713d7Copy full SHA for ef713d7
1 file changed
system/Database/Config.php
@@ -65,18 +65,12 @@ public static function connect($group = null, bool $getShared = true)
65
if (! isset($dbConfig->{$group})) {
66
throw new InvalidArgumentException($group . ' is not a valid database connection group.');
67
}
68
- }
69
70
- if ($getShared && isset(static::$instances[$group])) {
71
- return static::$instances[$group];
72
73
-
74
- if (isset($dbConfig->{$group})) {
75
$config = $dbConfig->{$group};
76
77
78
- if (! isset($config)) {
79
- throw new InvalidArgumentException('There is no valid database config.');
+ if ($getShared && isset(static::$instances[$group])) {
+ return static::$instances[$group];
80
81
82
static::ensureFactory();
0 commit comments