| Total Complexity | 7 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Changes | 4 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 15 | class TransactionMiddleware implements Middleware |
||
| 16 | { |
||
| 17 | private EntityManagerInterface $entityManager; |
||
| 18 | |||
| 19 | public function __construct(EntityManagerInterface $entityManager) |
||
| 20 | { |
||
| 21 | $this->entityManager = $entityManager; |
||
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Executes the given command and optionally returns a value |
||
| 26 | * |
||
| 27 | * @return mixed |
||
| 28 | * |
||
| 29 | * @throws Throwable |
||
| 30 | * @throws Exception |
||
| 31 | */ |
||
| 32 | public function execute(object $command, callable $next) |
||
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Rollback the current transaction and close the entity manager when possible. |
||
| 56 | */ |
||
| 57 | protected function rollbackTransaction(): void |
||
| 69 |