Conditions | 2 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | public function execute($command, callable $next) |
||
21 | { |
||
22 | $this->connection->beginTransaction(); |
||
23 | |||
24 | try { |
||
25 | /** @var mixed $result */ |
||
26 | $result = $next($command); |
||
27 | $this->connection->commit(); |
||
28 | } catch (Throwable $exception) { |
||
29 | $this->connection->rollBack(); |
||
30 | throw $exception; |
||
31 | } |
||
32 | |||
33 | return $result; |
||
34 | } |
||
36 |