| Conditions | 3 |
| Paths | 6 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function execute($command, callable $next) |
||
| 36 | { |
||
| 37 | $context = $this->isolate->getContext($this->contextName); |
||
| 38 | $transaction = $context->hasOpenTransaction() ? $context->getTransaction() : $context->openTransaction(); |
||
| 39 | |||
| 40 | try { |
||
| 41 | $returnValue = $next($command); |
||
| 42 | |||
| 43 | $context->closeTransaction(); |
||
| 44 | |||
| 45 | return $returnValue; |
||
| 46 | } catch (\Exception $e) { |
||
| 47 | $transaction->rollback(); |
||
| 48 | throw $e; |
||
| 49 | } |
||
| 50 | } |
||
| 51 | } |