Package::setStream()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 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