| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 58 | public function connect(): void |
||
| 59 | { |
||
| 60 | $resource = @stream_socket_client( |
||
| 61 | $this->protocol . $this->host . ':' . $this->port, |
||
| 62 | $errorCode, |
||
| 63 | $errorMessage, |
||
| 64 | $this->options->getTimeout() |
||
| 65 | ); |
||
| 66 | |||
| 67 | if ($resource === false) { |
||
| 68 | throw new ConnectionRefusedException( |
||
| 69 | sprintf('Could not create secure connection. %s.', $errorMessage), |
||
| 70 | $errorCode |
||
| 71 | ); |
||
| 72 | } |
||
| 73 | |||
| 74 | $this->resource = $resource; |
||
| 75 | $this->fireEvent('connect'); |
||
| 76 | } |
||
| 77 | } |