| Total Complexity | 5 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | final class TransactionManager implements TransactionManagerInterface |
||
| 12 | { |
||
| 13 | private $db; |
||
| 14 | |||
| 15 | public function __construct(Connection $db) |
||
| 16 | { |
||
| 17 | $this->db = $db; |
||
| 18 | } |
||
| 19 | |||
| 20 | public function begin(): void |
||
| 21 | { |
||
| 22 | $this->db->beginTransaction(); |
||
| 23 | } |
||
| 24 | |||
| 25 | public function commit(): void |
||
| 26 | { |
||
| 27 | $this->db->commit(); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function rollback(): void |
||
| 31 | { |
||
| 32 | $this->db->rollBack(); |
||
| 33 | } |
||
| 34 | |||
| 35 | public function run(Closure $fn): void |
||
| 38 | } |
||
| 39 | } |
||
| 40 |