Conditions | 2 |
Paths | 3 |
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 | 1 | EventStore::saveQueue(); |
|
24 | 2 | } catch (Exception $e) { |
|
25 | 1 | DB::rollBack(); |
|
26 | 1 | throw $e; |
|
27 | } |
||
28 | |||
29 | 1 | DB::commit(); |
|
30 | |||
31 | 1 | return $response; |
|
32 | } |
||
33 | } |
||
34 |