| Conditions | 2 |
| Paths | 6 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | protected function handleForManager( |
||
| 18 | EntityManagerInterface $entityManager, |
||
| 19 | Envelope $envelope, |
||
| 20 | StackInterface $stack |
||
| 21 | ): Envelope { |
||
| 22 | try { |
||
| 23 | $connection = $entityManager->getConnection(); |
||
| 24 | |||
| 25 | return $stack->next()->handle($envelope, $stack); |
||
| 26 | } finally { |
||
| 27 | if (null !== $envelope->last(ConsumedByWorkerStamp::class)) { |
||
| 28 | $connection->close(); |
||
| 29 | } |
||
| 33 |