Conditions | 5 |
Paths | 5 |
Total Lines | 15 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 5.3906 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | 34 | protected function createIoInterface($type, $address) |
|
23 | { |
||
24 | switch ($type) { |
||
25 | 34 | case self::SOCKET_TYPE_UNIX: |
|
26 | return new StreamedClientIo($this); |
||
27 | 34 | case self::SOCKET_TYPE_TCP: |
|
28 | 31 | return new StreamedClientIo($this); |
|
29 | 3 | case self::SOCKET_TYPE_UDG: |
|
30 | return new DatagramClientIo($this, null); |
||
31 | 3 | case self::SOCKET_TYPE_UDP: |
|
32 | return new DatagramClientIo($this, $address); |
||
33 | 3 | default: |
|
34 | 3 | throw new \LogicException("Unsupported socket resource type {$type}"); |
|
35 | 3 | } |
|
36 | } |
||
37 | } |
||
38 |