Connection   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 47
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __destruct() 0 5 1
A getId() 0 4 1
A getSocket() 0 4 1
1
<?php
2
3
namespace Dazzle\ChannelSocket\Connection;
4
5
use Dazzle\Socket\SocketInterface;
6
7
/**
8
 * @codeCoverageIgnore
9
 */
10
class Connection
11
{
12
    /**
13
     * @var string
14
     */
15
    public $id;
16
17
    /**
18
     * @var SocketInterface
19
     */
20
    public $client;
21
22
    /**
23
     * @param string $id
24
     * @param SocketInterface $client
25
     */
26
    public function __construct($id, SocketInterface $client)
27
    {
28
        $this->id = $id;
29
        $this->client = $client;
30
    }
31
32
    /**
33
     *
34
     */
35
    public function __destruct()
36
    {
37
        unset($this->id);
38
        unset($this->client);
39
    }
40
41
    /**
42
     * @return string
43
     */
44
    public function getId()
45
    {
46
        return $this->id;
47
    }
48
49
    /**
50
     * @return SocketInterface
51
     */
52
    public function getSocket()
53
    {
54
        return $this->client;
55
    }
56
}
57