Package   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 45
ccs 10
cts 10
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getData() 0 4 1
A getStream() 0 4 1
A setStream() 0 6 1
1
<?php
2
3
namespace Thruster\Component\PacketHandler;
4
5
use Thruster\Component\Stream\Stream;
6
7
/**
8
 * Class Package
9
 *
10
 * @package Thruster\Component\PacketHandler
11
 * @author  Aurimas Niekis <[email protected]>
12
 */
13
class Package
14
{
15
    /**
16
     * @var array
17
     */
18
    private $data;
19
20
    /**
21
     * @var Stream
22
     */
23
    private $stream;
24
25 5
    public function __construct(array $data)
26
    {
27 5
        $this->data = $data;
28 5
    }
29
30
    /**
31
     * @return array
32
     */
33 4
    public function getData() : array
34
    {
35 4
        return $this->data;
36
    }
37
38
    /**
39
     * @return Stream
40
     */
41 2
    public function getStream() : Stream
42
    {
43 2
        return $this->stream;
44
    }
45
46
    /**
47
     * @param Stream $stream
48
     *
49
     * @return $this
50
     */
51 3
    public function setStream(Stream $stream)
52
    {
53 3
        $this->stream = $stream;
54
55 3
        return $this;
56
    }
57
}
58