AbstractBlockLocator::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
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 2
dl 0
loc 6
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BitWasp\Bitcoin\Networking\Messages;
6
7
use BitWasp\Bitcoin\Chain\BlockLocator;
8
use BitWasp\Bitcoin\Networking\NetworkSerializable;
9
10
abstract class AbstractBlockLocator extends NetworkSerializable
11
{
12
    /**
13
     * The protocol version
14
     * @var int
15
     */
16
    private $version;
17
18
    /**
19
     * The block locator structure
20
     *
21
     * @var BlockLocator
22
     */
23
    private $locator;
24 6
25
    /**
26
     * @param int $version
27
     * @param BlockLocator $locator
28 6
     */
29 6
    public function __construct(
30 6
        int $version,
31
        BlockLocator $locator
32
    ) {
33
        $this->version = $version;
34
        $this->locator = $locator;
35 6
    }
36
37 6
    /**
38
     * @return int
39
     */
40
    public function getVersion(): int
41
    {
42
        return $this->version;
43 6
    }
44
45 6
    /**
46
     * @return BlockLocator
47
     */
48
    public function getLocator(): BlockLocator
49
    {
50
        return $this->locator;
51
    }
52
}
53