Completed
Push — master ( 99440d...816aa4 )
by Chris
03:23 queued 10s
created

Header   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getFrameAddress() 0 3 1
A getFrame() 0 3 1
A getProtocolHeader() 0 3 1
A __construct() 0 5 1
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 23
    public function __construct(Frame $frame, FrameAddress $frameAddress, ProtocolHeader $protocolHeader)
14
    {
15 23
        $this->frame = $frame;
16 23
        $this->frameAddress = $frameAddress;
17 23
        $this->protocolHeader = $protocolHeader;
18
    }
19
20 16
    public function getFrame(): Frame
21
    {
22 16
        return $this->frame;
23
    }
24
25 13
    public function getFrameAddress(): FrameAddress
26
    {
27 13
        return $this->frameAddress;
28
    }
29
30 10
    public function getProtocolHeader(): ProtocolHeader
31
    {
32 10
        return $this->protocolHeader;
33
    }
34
}
35