Passed
Push — master ( 064a98...723530 )
by kacper
04:52
created

JsonBinaryDecoderValue   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 13
dl 0
loc 37
ccs 0
cts 26
cp 0
rs 10
c 2
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A getOffset() 0 3 1
A __construct() 0 10 1
A getValue() 0 3 1
A isIsResolved() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace MySQLReplication\JsonBinaryDecoder;
5
6
class JsonBinaryDecoderValue
7
{
8
    private $isResolved;
9
    private $value;
10
    private $type;
11
    private $offset;
12
13
    public function __construct(
14
        bool $isResolved,
15
        $value,
16
        int $type,
17
        int $offset = null
18
    ) {
19
        $this->isResolved = $isResolved;
20
        $this->value = $value;
21
        $this->type = $type;
22
        $this->offset = $offset;
23
    }
24
25
    public function getOffset(): int
26
    {
27
        return $this->offset;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->offset could return the type null which is incompatible with the type-hinted return integer. Consider adding an additional type-check to rule them out.
Loading history...
28
    }
29
30
    public function getValue()
31
    {
32
        return $this->value;
33
    }
34
35
    public function isIsResolved(): bool
36
    {
37
        return $this->isResolved;
38
    }
39
40
    public function getType(): int
41
    {
42
        return $this->type;
43
    }
44
}