Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
27 | 9 | public function getSql(SqlWalker $sqlWalker) |
|
28 | { |
||
29 | 9 | switch ($sqlWalker->getConnection()->getDatabasePlatform()->getName()) { |
|
30 | 9 | case 'postgresql': |
|
31 | 3 | return 'RANDOM()'; |
|
32 | break; |
||
|
|||
33 | 6 | case 'mysql': |
|
34 | 3 | return 'RAND()'; |
|
35 | break; |
||
36 | 2 | default: |
|
37 | 3 | throw new QueryException("You can't use RANDOM()!"); |
|
38 | 2 | } |
|
39 | } |
||
40 | } |
||
41 |
The break statement is not necessary if it is preceded for example by a return 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.