| Conditions | 3 |
| Paths | 5 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 39 | public function execute($command, callable $next) |
||
| 40 | { |
||
| 41 | $this->database->beginTransaction(); |
||
| 42 | |||
| 43 | try { |
||
| 44 | $returnValue = $next($command); |
||
| 45 | |||
| 46 | $this->database->commit(); |
||
| 47 | } catch (Exception $exception) { |
||
| 48 | $this->database->rollBack(); |
||
| 49 | |||
| 50 | throw $exception; |
||
| 51 | } catch (Throwable $exception) { |
||
|
|
|||
| 52 | $this->database->rollBack(); |
||
| 53 | |||
| 54 | throw $exception; |
||
| 55 | } |
||
| 56 | |||
| 57 | return $returnValue; |
||
| 58 | } |
||
| 59 | } |
||
| 60 |