WebSocketClient::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 1 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 3
b 1
f 0
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