1 | <?php |
||
10 | class BlockHeader extends Serializable implements BlockHeaderInterface |
||
11 | { |
||
12 | |||
13 | /** |
||
14 | * @var int |
||
15 | */ |
||
16 | private $version; |
||
17 | |||
18 | /** |
||
19 | * @var BufferInterface |
||
20 | */ |
||
21 | private $prevBlock; |
||
22 | |||
23 | /** |
||
24 | * @var BufferInterface |
||
25 | */ |
||
26 | private $merkleRoot; |
||
27 | |||
28 | /** |
||
29 | * @var int |
||
30 | */ |
||
31 | private $timestamp; |
||
32 | |||
33 | /** |
||
34 | * @var int |
||
35 | */ |
||
36 | private $bits; |
||
37 | |||
38 | /** |
||
39 | * @var int |
||
40 | */ |
||
41 | private $nonce; |
||
42 | |||
43 | /** |
||
44 | * @param int $version |
||
45 | * @param BufferInterface $prevBlock |
||
46 | * @param BufferInterface $merkleRoot |
||
47 | * @param int $timestamp |
||
48 | * @param int $bits |
||
49 | * @param int $nonce |
||
50 | */ |
||
51 | 63 | public function __construct($version, BufferInterface $prevBlock, BufferInterface $merkleRoot, $timestamp, $bits, $nonce) |
|
68 | |||
69 | /** |
||
70 | * @return BufferInterface |
||
71 | */ |
||
72 | 573 | public function getHash() |
|
76 | |||
77 | /** |
||
78 | * Get the version for this block |
||
79 | * |
||
80 | * {@inheritdoc} |
||
81 | * @see \BitWasp\Bitcoin\Block\BlockHeaderInterface::getVersion() |
||
82 | */ |
||
83 | 600 | public function getVersion() |
|
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | * @see \BitWasp\Bitcoin\Block\BlockHeaderInterface::getPrevBlock() |
||
91 | */ |
||
92 | 600 | public function getPrevBlock() |
|
96 | |||
97 | /** |
||
98 | * {@inheritdoc} |
||
99 | * @see \BitWasp\Bitcoin\Block\BlockHeaderInterface::getMerkleRoot() |
||
100 | */ |
||
101 | 609 | public function getMerkleRoot() |
|
105 | |||
106 | /** |
||
107 | * {@inheritdoc} |
||
108 | * @see \BitWasp\Bitcoin\Block\BlockHeaderInterface::getBits() |
||
109 | */ |
||
110 | 597 | public function getBits() |
|
114 | |||
115 | /** |
||
116 | * {@inheritdoc} |
||
117 | * @see \BitWasp\Bitcoin\Block\BlockHeaderInterface::getNonce() |
||
118 | */ |
||
119 | 600 | public function getNonce() |
|
123 | |||
124 | /** |
||
125 | * Get the timestamp for this block |
||
126 | * |
||
127 | * {@inheritdoc} |
||
128 | * @see \BitWasp\Bitcoin\Block\BlockHeaderInterface::getTimestamp() |
||
129 | */ |
||
130 | 600 | public function getTimestamp() |
|
134 | |||
135 | /** |
||
136 | * @param BlockHeaderInterface $other |
||
137 | * @return bool |
||
138 | */ |
||
139 | public function equals(BlockHeaderInterface $other) |
||
148 | |||
149 | /** |
||
150 | * {@inheritdoc} |
||
151 | * @see \BitWasp\Buffertools\SerializableInterface::getBuffer() |
||
152 | */ |
||
153 | 576 | public function getBuffer() |
|
157 | } |
||
158 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: