seria/src/Torrents/AnnounceEmpty.php

21 lines
472 B
PHP

<?php
namespace Seria\Torrents;
use Index\Serialisation\IBencodeSerialisable;
class AnnounceEmpty implements IBencodeSerialisable {
public function __construct(
private bool $compactPeers
) {}
public function bencodeSerialise(): mixed {
return [
'interval' => 0,
'min interval' => 0,
'complete' => 0,
'incomplete' => 0,
'peers' => $this->compactPeers ? '' : [],
];
}
}