1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
/** |
3
|
|
|
* This file is part of the ngutech/bitcoin-interop project. |
4
|
|
|
* |
5
|
|
|
* For the full copyright and license information, please view the LICENSE |
6
|
|
|
* file that was distributed with this source code. |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace NGUtech\Bitcoin\Entity; |
10
|
|
|
|
11
|
|
|
use Daikon\Entity\Attribute; |
12
|
|
|
use Daikon\Entity\AttributeMap; |
13
|
|
|
use Daikon\Entity\EntityInterface; |
14
|
|
|
use Daikon\Entity\EntityTrait; |
15
|
|
|
use Daikon\ValueObject\IntValue; |
16
|
|
|
use Daikon\ValueObject\Timestamp; |
|
|
|
|
17
|
|
|
use NGUtech\Bitcoin\ValueObject\Hash; |
18
|
|
|
use NGUtech\Bitcoin\ValueObject\HashList; |
19
|
|
|
|
20
|
|
|
final class BitcoinBlock implements EntityInterface |
21
|
|
|
{ |
22
|
|
|
use EntityTrait; |
23
|
|
|
|
24
|
|
|
public static function getAttributeMap(): AttributeMap |
25
|
|
|
{ |
26
|
|
|
return new AttributeMap([ |
27
|
|
|
Attribute::define('hash', Hash::class), |
28
|
|
|
Attribute::define('merkleRoot', Hash::class), |
29
|
|
|
Attribute::define('confirmations', IntValue::class), |
30
|
|
|
Attribute::define('transactions', HashList::class), |
31
|
|
|
Attribute::define('height', IntValue::class), |
32
|
|
|
Attribute::define('timestamp', Timestamp::class) |
33
|
|
|
]); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
public function getIdentity(): Hash |
37
|
|
|
{ |
38
|
|
|
return $this->getHash(); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
public function getHash(): Hash |
42
|
|
|
{ |
43
|
|
|
return $this->get('hash') ?? Hash::makeEmpty(); |
|
|
|
|
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function getMerkleRoot(): Hash |
47
|
|
|
{ |
48
|
|
|
return $this->get('merkleRoot') ?? Hash::makeEmpty(); |
|
|
|
|
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
public function getConfirmations(): IntValue |
52
|
|
|
{ |
53
|
|
|
return $this->get('confirmations') ?? IntValue::zero(); |
|
|
|
|
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
public function getTransactions(): HashList |
57
|
|
|
{ |
58
|
|
|
return $this->get('transactions') ?? HashList::makeEmpty(); |
|
|
|
|
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
public function getHeight(): IntValue |
62
|
|
|
{ |
63
|
|
|
return $this->get('height') ?? IntValue::zero(); |
|
|
|
|
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
public function getTimestamp(): Timestamp |
67
|
|
|
{ |
68
|
|
|
return $this->get('timestamp') ?? Timestamp::makeEmpty(); |
|
|
|
|
69
|
|
|
} |
70
|
|
|
} |
71
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths