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