Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 4 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
20 | 4 | public function invoke(MethodInvocation $invocation) |
|
21 | { |
||
22 | 4 | $result = null; |
|
23 | |||
24 | try { |
||
25 | 4 | $this->entityManager->transactional(function () use ($invocation, &$result) { |
|
26 | 4 | $result = $invocation->proceed(); |
|
27 | 4 | }); |
|
28 | 4 | } catch (\Exception $e) { |
|
29 | 2 | throw new RollbackException('Transaction rolled back.', 0, $e); |
|
30 | } |
||
31 | |||
32 | 2 | return $result; |
|
33 | } |
||
34 | } |
||
35 |