| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 12 | public function connect(string $address, array $options = []): TransportInterface |
|
| 19 | { |
||
| 20 | 12 | if ($this->target === null) { |
|
| 21 | 12 | $timeout = (float)($options['timeout'] ??(float) ini_get('default_socket_timeout')); |
|
| 22 | 12 | $port = $options['port'] ?? 0; |
|
| 23 | 12 | $url = $this->schema . $address; |
|
| 24 | 12 | $this->target = fsockopen($url, $port, $this->errorNumber, $this->errorMessage, $timeout); |
|
| 25 | } |
||
| 26 | |||
| 27 | 12 | return $this; |
|
| 28 | } |
||
| 29 | } |
||
| 30 |