| Conditions | 4 |
| Paths | 5 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 42 | protected function makeSocketCluster($config) |
||
| 43 | { |
||
| 44 | if (empty($config['uri'])) { |
||
| 45 | $scheme = $config['secure']==true ? 'wss' : 'ws'; |
||
| 46 | $host = trim($config['host'], "/"); |
||
| 47 | $port = !empty($config['port']) ? ":".$config['port'] : ''; |
||
| 48 | $path = trim($config['path'], "/"); |
||
| 49 | $config['uri'] = sprintf("%s://%s%s/%s/", $scheme, $host, $port, $path); |
||
| 50 | } |
||
| 51 | |||
| 52 | return new SocketCluster(new WebSocketClient($config['uri'])); |
||
| 53 | } |
||
| 54 | } |