UnknownMessage::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace DaveRandom\LibLifxLan\Messages;
4
5
final class UnknownMessage implements Message
6
{
7
    private $typeId;
8
    private $data;
9
10 5
    public function __construct(int $typeId, string $data)
11
    {
12 5
        $this->typeId = $typeId;
13 5
        $this->data = $data;
14
    }
15
16 3
    public function getData(): string
17
    {
18 3
        return $this->data;
19
    }
20
21 1
    public function getTypeId(): int
22
    {
23 1
        return $this->typeId;
24
    }
25
26 1
    public function getWireSize(): int
27
    {
28 1
        return \strlen($this->data);
29
    }
30
}
31