AbstractBlockLocator   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 41
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getLocator() 0 3 1
A getVersion() 0 3 1
A __construct() 0 6 1
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