Completed
Push — master ( 6dbf2d...486f74 )
by Chris
02:44
created

Header::setFrameAddress()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace DaveRandom\LibLifxLan\Header;
4
5
final class Header
6
{
7
    public const WIRE_SIZE = Frame::WIRE_SIZE + FrameAddress::WIRE_SIZE + ProtocolHeader::WIRE_SIZE;
8
9
    private $frame;
10
    private $frameAddress;
11
    private $protocolHeader;
12
13 3
    private function setFrame(Frame $frame): void
14
    {
15 3
        $this->frame = $frame;
16
    }
17
18 3
    private function setFrameAddress(FrameAddress $frameAddress): void
19
    {
20 3
        $this->frameAddress = $frameAddress;
21
    }
22
23 3
    private function setProtocolHeader(ProtocolHeader $protocolHeader): void
24
    {
25 3
        $this->protocolHeader = $protocolHeader;
26
    }
27
28 3
    public function __construct(Frame $frame, FrameAddress $frameAddress, ProtocolHeader $protocolHeader)
29
    {
30 3
        $this->setFrame($frame);
31 3
        $this->setFrameAddress($frameAddress);
32 3
        $this->setProtocolHeader($protocolHeader);
33
    }
34
35 1
    public function getFrame(): Frame
36
    {
37 1
        return $this->frame;
38
    }
39
40 1
    public function getFrameAddress(): FrameAddress
41
    {
42 1
        return $this->frameAddress;
43
    }
44
45 1
    public function getProtocolHeader(): ProtocolHeader
46
    {
47 1
        return $this->protocolHeader;
48
    }
49
}
50