Conditions | 4 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
40 | 13 | protected function createSocketResource($address, $context) |
|
41 | { |
||
42 | 13 | $resource = stream_socket_client( |
|
43 | 13 | $address . ($this->persistentKey ? '/' . $this->persistentKey : ''), |
|
44 | 13 | $errno, |
|
45 | 13 | $errstr, |
|
46 | 13 | null, |
|
47 | 13 | STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT | STREAM_CLIENT_PERSISTENT, |
|
48 | $context |
||
49 | 13 | ); |
|
50 | |||
51 | 13 | if ($errno || $resource === false) { |
|
52 | 2 | throw new NetworkSocketException($this, $errstr, $errno); |
|
53 | } |
||
54 | |||
55 | 11 | return $resource; |
|
56 | } |
||
57 | } |
||
58 |