WebSocketClient   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
namespace WSSC;
4
5
use WSSC\Components\ClientConfig;
6
use WSSC\Components\WscMain;
7
8
class WebSocketClient extends WscMain
9
{
10
    /**
11
     * Sets parameters for Web Socket Client intercommunication
12
     *
13
     * @param string $url string representation of a socket utf, ex.: tcp://www.example.com:8000 or udp://example.com:13
14
     * @param ClientConfig $config Client configuration settings e.g.: connection - timeout, ssl options, fragment message size to send etc.
15
     * @throws \InvalidArgumentException
16
     * @throws Exceptions\BadUriException
17
     * @throws Exceptions\ConnectionException
18
     * @throws \Exception
19
     */
20
    public function __construct(string $url, ClientConfig $config)
21
    {
22
        $this->socketUrl = $url;
23
        $this->connect($config);
24
    }
25
}
26