Conditions | 3 |
Paths | 7 |
Total Lines | 20 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | public function execute(object $command, callable $next) |
||
33 | { |
||
34 | $this->entityManager->beginTransaction(); |
||
35 | |||
36 | try { |
||
37 | $returnValue = $next($command); |
||
38 | |||
39 | $this->entityManager->flush(); |
||
40 | $this->entityManager->commit(); |
||
41 | } catch (Exception $e) { |
||
42 | $this->rollbackTransaction(); |
||
43 | |||
44 | throw $e; |
||
45 | } catch (Throwable $e) { |
||
46 | $this->rollbackTransaction(); |
||
47 | |||
48 | throw $e; |
||
49 | } |
||
50 | |||
51 | return $returnValue; |
||
52 | } |
||
69 |