Conditions | 1 |
Paths | 1 |
Total Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
35 | public function connect(string $address, int $port = 0, array $options = []): TransportInterface |
||
36 | { |
||
37 | $timeout = (float)($options['timeout'] ??(float) ini_get('default_socket_timeout')); |
||
38 | $url = $this->socketPrefix . $address; |
||
39 | $this->socket = @fsockopen($url, $port, $this->errorNumber, $this->errorMessage, $timeout); |
||
40 | |||
41 | return $this; |
||
42 | } |
||
43 | |||
66 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.