Framing   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 7
dl 0
loc 36
c 0
b 0
f 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A socket() 0 3 1
A message() 0 3 1
A __construct() 0 4 1
1
<?php
2
/**
3
 * Client framing ops (websocket)
4
 * User: moyo
5
 * Date: 2018/6/27
6
 * Time: 10:44 AM
7
 */
8
9
namespace Carno\HTTP\Client;
10
11
use Carno\Channel\Channel;
12
use Carno\HTTP\Contracts\WSocket;
13
14
class Framing
15
{
16
    /**
17
     * @var Channel
18
     */
19
    private $chan = null;
20
21
    /**
22
     * @var WSocket
23
     */
24
    private $socket = null;
25
26
    /**
27
     * Framing constructor.
28
     * @param WSocket $socket
29
     */
30
    public function __construct(WSocket $socket)
31
    {
32
        $this->socket = $socket;
33
        $this->chan = new Channel;
34
    }
35
36
    /**
37
     * @return WSocket
38
     */
39
    public function socket() : WSocket
40
    {
41
        return $this->socket;
42
    }
43
44
    /**
45
     * @return Channel
46
     */
47
    public function message() : Channel
48
    {
49
        return $this->chan;
50
    }
51
}
52