| Total Complexity | 4 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class Block extends NetworkSerializable |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var BufferInterface |
||
| 15 | */ |
||
| 16 | private $blockData; |
||
| 17 | |||
| 18 | public function __construct(BufferInterface $blockData) |
||
| 19 | 6 | { |
|
| 20 | $this->blockData = $blockData; |
||
| 21 | 6 | } |
|
| 22 | 6 | ||
| 23 | /** |
||
| 24 | * {@inheritdoc} |
||
| 25 | * @see https://en.bitcoin.it/wiki/Protocol_documentation#block |
||
| 26 | * @see \BitWasp\Bitcoin\Network\NetworkSerializableInterface::getNetworkCommand() |
||
| 27 | */ |
||
| 28 | 6 | public function getNetworkCommand(): string |
|
| 29 | { |
||
| 30 | 6 | return Message::BLOCK; |
|
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @return BufferInterface |
||
| 35 | */ |
||
| 36 | 3 | public function getBlockData(): BufferInterface |
|
| 37 | { |
||
| 38 | 3 | return $this->blockData; |
|
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * {@inheritdoc} |
||
| 43 | * @see \BitWasp\Bitcoin\SerializableInterface::getBuffer() |
||
| 44 | */ |
||
| 45 | 6 | public function getBuffer(): BufferInterface |
|
| 48 | } |
||
| 49 | } |
||
| 50 |