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