| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function flush(): void |
||
| 27 | { |
||
| 28 | if ($this->hasEntityManager()) { |
||
| 29 | /** @var EntityManager $entityManager */ |
||
| 30 | $entityManager = $this->managerRegistry->getManager(); |
||
| 31 | $connection = $entityManager->getConnection(); |
||
| 32 | if (!$connection->ping()) { |
||
| 33 | $connection->close(); |
||
| 34 | $connection->connect(); |
||
| 35 | } |
||
| 36 | $entityManager->flush(); |
||
| 37 | } |
||
| 38 | } |
||
| 39 | |||
| 58 |