Conditions | 3 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
32 | public function execute(object $command, callable $next) |
||
33 | { |
||
34 | $this->connection->beginTransaction(); |
||
35 | |||
36 | try { |
||
37 | $returnValue = $next($command); |
||
38 | |||
39 | $this->connection->commit(); |
||
40 | } catch (Exception $exception) { |
||
41 | $this->connection->rollBack(); |
||
42 | |||
43 | throw $exception; |
||
44 | } catch (Throwable $exception) { |
||
45 | $this->connection->rollBack(); |
||
46 | |||
47 | throw $exception; |
||
48 | } |
||
49 | |||
50 | return $returnValue; |
||
51 | } |
||
53 |