| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace C4tech\RayEmitter\Event; |
||
| 17 | 2 | public function handle($request, Closure $next) |
|
| 18 | { |
||
| 19 | 2 | DB::beginTransaction(); |
|
| 20 | |||
| 21 | try { |
||
| 22 | 2 | $response = $next($request); |
|
| 23 | 2 | } catch (Exception $e) { |
|
| 24 | 1 | DB::rollBack(); |
|
| 25 | 1 | throw $e; |
|
| 26 | } |
||
| 27 | |||
| 28 | 1 | DB::commit(); |
|
| 29 | 1 | EventStore::publishQueue(); |
|
| 30 | |||
| 31 | 1 | return $response; |
|
| 32 | } |
||
| 33 | } |
||
| 34 |