| Conditions | 4 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | 27 | public static function make(string $name): Grammar { |
|
| 21 | 27 | switch($name){ |
|
|
|
|||
| 22 | 27 | case 'mysql': |
|
| 23 | 13 | return new MySqlGrammar(); |
|
| 24 | break; |
||
| 25 | 14 | case 'postgresql': |
|
| 26 | 1 | case 'pg_sql': |
|
| 27 | 13 | return new PostgresGrammar(); |
|
| 28 | break; |
||
| 29 | } |
||
| 30 | |||
| 31 | 1 | throw new \InvalidArgumentException(\sprintf('%s is not a supported grammar.', $name)); |
|
| 32 | } |
||
| 33 | } |