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