| Conditions | 4 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4.0312 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | 2 | private static function handleException(Orm $orm, $statement, \Exception $ex, string $message = null, int $code = 0) |
|
| 31 | { |
||
| 32 | 2 | $toThrow = OrmException::fromPrevious($ex, $message, $code); |
|
| 33 | |||
| 34 | try { |
||
| 35 | 2 | if ($statement != null && $statement instanceof \PDOStatement) { |
|
| 36 | 1 | $statement->closeCursor(); |
|
| 37 | } |
||
| 38 | 2 | unset($statement); |
|
| 39 | } catch (\PDOException $cex) { |
||
| 40 | // Ignore close cursor exception |
||
| 41 | } |
||
| 42 | |||
| 43 | 2 | $toThrow = $orm->rollBackTX($toThrow); |
|
| 44 | |||
| 45 | 2 | return $toThrow; |
|
| 46 | } |
||
| 47 | } |
||
| 48 |