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

JsonBinaryDecoderValue::getValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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