Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 3.3332 |
Changes | 0 |
1 | <?php |
||
12 | 1 | public function getExceptionType(string $sql_state, int $error_code, string $error_message): string |
|
13 | { |
||
14 | switch ($sql_state) { |
||
15 | 1 | case '23503': |
|
16 | return ForeignKeyException::class; |
||
17 | |||
18 | 1 | case '23505': |
|
19 | return UniqueConstraintException::class; |
||
20 | |||
21 | default: |
||
22 | 1 | return SQLException::class; |
|
23 | } |
||
26 |