Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
27 | 4 | protected function setTransactionIsolationLevel(string $level): void |
|
28 | { |
||
29 | switch ($level) { |
||
30 | 4 | case self::SERIALIZABLE: |
|
31 | 1 | $this->db->createCommand('PRAGMA read_uncommitted = False;')->execute(); |
|
32 | 1 | break; |
|
33 | 4 | case self::READ_UNCOMMITTED: |
|
34 | 3 | $this->db->createCommand('PRAGMA read_uncommitted = True;')->execute(); |
|
35 | 3 | break; |
|
36 | default: |
||
37 | 1 | throw new NotSupportedException( |
|
38 | 1 | self::class . ' only supports transaction isolation levels READ UNCOMMITTED and SERIALIZABLE.' |
|
39 | 1 | ); |
|
43 |