Conditions | 4 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | public static function make(string $name): Grammar |
||
22 | { |
||
23 | switch ($name) { |
||
24 | case 'mysql': |
||
25 | return new MySqlGrammar(); |
||
26 | break; |
||
|
|||
27 | case 'postgresql': |
||
28 | case 'pg_sql': |
||
29 | return new PostgresGrammar(); |
||
30 | break; |
||
31 | } |
||
32 | |||
33 | throw new \InvalidArgumentException(\sprintf('%s is not a supported grammar.', $name)); |
||
34 | } |
||
36 |
The
break
statement is not necessary if it is preceded for example by areturn
statement:If you would like to keep this construct to be consistent with other
case
statements, you can safely mark this issue as a false-positive.