File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -162,18 +162,15 @@ protected function getJsonGrammar(Builder $query): JsonGrammar
162162 {
163163 $ driver = $ query ->getConnection ()->getDriverName ();
164164
165- switch ($ driver ) {
166- case 'mysql ' :
167- return $ query ->getConnection ()->withTablePrefix (new MySqlGrammar ());
168- case 'pgsql ' :
169- return $ query ->getConnection ()->withTablePrefix (new PostgresGrammar ());
170- case 'sqlite ' :
171- return $ query ->getConnection ()->withTablePrefix (new SqliteGrammar ());
172- case 'sqlsrv ' :
173- return $ query ->getConnection ()->withTablePrefix (new SqlServerGrammar ());
174- }
175-
176- throw new RuntimeException ('This database is not supported. ' ); // @codeCoverageIgnore
165+ return $ query ->getConnection ()->withTablePrefix (
166+ match ($ driver ) {
167+ 'mysql ' => new MySqlGrammar (),
168+ 'pgsql ' => new PostgresGrammar (),
169+ 'sqlite ' => new SqliteGrammar (),
170+ 'sqlsrv ' => new SqlServerGrammar (),
171+ default => throw new RuntimeException ('This database is not supported. ' ) // @codeCoverageIgnore
172+ }
173+ );
177174 }
178175
179176 /**
You can’t perform that action at this time.
0 commit comments