| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function isValid(): bool |
||
| 24 | { |
||
| 25 | $op = @fsockopen($this->host, $this->port, $errno, $errstr, 0.5); |
||
| 26 | |||
| 27 | if (!$op) { |
||
|
|
|||
| 28 | return false; |
||
| 29 | } |
||
| 30 | |||
| 31 | fclose($op); |
||
| 32 | |||
| 33 | try { |
||
| 34 | $this->pdo = new \PDO($this->dsn, $this->username, $this->password, $this->options); |
||
| 35 | return true; |
||
| 36 | } catch (\PDOException $e) { |
||
| 37 | return false; |
||
| 38 | } |
||
| 54 |