Passed
Push — master ( beaa4b...da3f2a )
by Shahrad
02:02
created

WebSocket   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 14
c 1
b 0
f 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
namespace EasyHttp;
4
5
use EasyHttp\Utils\WSConfig;
6
use EasyHttp\Utils\WscMain;
7
use Exception;
8
9
/**
10
 * WebSocket class
11
 *
12
 * @link    https://github.com/shahradelahi/easy-http
13
 * @author  Arthur Kushman (https://github.com/arthurkushman)
14
 * @license https://github.com/shahradelahi/easy-http/blob/master/LICENSE (MIT License)
15
 */
16
class WebSocket extends WscMain
17
{
18
19
	/**
20
	 * Sets parameters for Web Socket Client intercommunication
21
	 *
22
	 * @param string $url string representation of a socket utf, ex.: tcp://www.example.com:8000 or udp://example.com:13
23
	 * @param WSConfig $config Client configuration settings e.g.: connection - timeout, ssl options, fragment message size to send etc.
24
	 * @throws Exception
25
	 */
26
	public function __construct(string $url, WSConfig $config)
27
	{
28
		$this->socketUrl = $url;
29
		$this->connect($config);
30
	}
31
32
}
33