| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 9 | public function commit() |
|
| 30 | { |
||
| 31 | 9 | --$this->transactionCpt; |
|
| 32 | |||
| 33 | 9 | if ($this->transactionCpt < 0) { |
|
| 34 | 3 | throw new NoRunningTransactionException('Cannot commit before a transaction has begun'); |
|
| 35 | 6 | } elseif ($this->transactionCpt === 0) { |
|
| 36 | 3 | parent::commit(); |
|
| 37 | 3 | $this->reset(); |
|
| 38 | 3 | } |
|
| 39 | 6 | } |
|
| 40 | |||
| 63 |