| Total Complexity | 6 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class Ping extends NetworkSerializable |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var BufferInterface |
||
| 17 | */ |
||
| 18 | private $nonce; |
||
| 19 | |||
| 20 | /** |
||
| 21 | 9 | * Ping constructor. |
|
| 22 | * @param BufferInterface $nonce |
||
| 23 | 9 | */ |
|
| 24 | 9 | public function __construct(BufferInterface $nonce) |
|
| 30 | } |
||
| 31 | 9 | ||
| 32 | /** |
||
| 33 | * @param Random $random |
||
| 34 | * @return Ping |
||
| 35 | * @throws \BitWasp\Bitcoin\Exceptions\RandomBytesFailure |
||
| 36 | */ |
||
| 37 | 18 | public static function generate(Random $random): Ping |
|
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @return string |
||
| 44 | * @see https://en.bitcoin.it/wiki/Protocol_documentation#ping |
||
| 45 | 9 | */ |
|
| 46 | public function getNetworkCommand(): string |
||
| 47 | 9 | { |
|
| 48 | return Message::PING; |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @return BufferInterface |
||
| 53 | */ |
||
| 54 | public function getNonce(): BufferInterface |
||
| 55 | { |
||
| 56 | return $this->nonce; |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return BufferInterface |
||
| 61 | */ |
||
| 62 | public function getBuffer(): BufferInterface |
||
| 65 | } |
||
| 66 | } |
||
| 67 |