| Conditions | 3 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | private function pingConnection(EntityManagerInterface $entityManager): void |
||
| 32 | { |
||
| 33 | $connection = $entityManager->getConnection(); |
||
| 34 | |||
| 35 | try { |
||
| 36 | $this->executeDummySql($connection); |
||
| 37 | } catch (Exception) { |
||
| 38 | $connection->close(); |
||
| 39 | // Attempt to reestablish the lazy connection by sending another query. |
||
| 40 | $this->executeDummySql($connection); |
||
| 41 | } |
||
| 42 | |||
| 43 | if (! $entityManager->isOpen()) { |
||
| 44 | $this->managerRegistry->resetManager($this->entityManagerName); |
||
| 45 | } |
||
| 56 |