| Conditions | 2 |
| Paths | 5 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | private function ping(Connection $connection): bool |
||
| 43 | { |
||
| 44 | set_error_handler(static function (int $severity, string $message, string $file, int $line): bool { |
||
| 45 | throw new ErrorException($message, $severity, $severity, $file, $line); |
||
| 46 | }); |
||
| 47 | |||
| 48 | try { |
||
| 49 | $dummySelectSQL = $connection->getDatabasePlatform()->getDummySelectSQL(); |
||
| 50 | |||
| 51 | $connection->executeQuery($dummySelectSQL); |
||
| 52 | |||
| 53 | return true; |
||
| 54 | } catch (Throwable $exception) { |
||
| 55 | return false; |
||
| 56 | } finally { |
||
| 57 | restore_error_handler(); |
||
| 58 | } |
||
| 61 |