final class ByteChoices
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.

Consumes input choices while constructing an immutable generation plan.

Methods§

public function __construct(private string $bytes)

Captures one stream for this plan construction only.

Parameters

$bytesstring
public static function encode(int $count, int $index): string

Writes the little-endian bytes index() reads back as the same choice; the index must select one of the candidates.

Parameters

$countint
$indexint

Returns

string

Throws

InvalidArgumentException When the candidate count is not positive
Test cases 1
Called from 2
Calls 2
public static function width(int $count): int

Counts the little-endian bytes used by both encoder and decoder.

Parameters

$countint

Returns

int

Throws

InvalidArgumentException When the candidate count is not positive
Test cases 1
Called from 2
Calls 2

Private surface 2§

Implementation details, listed for orientation only.

private int $position = 0
private string $bytes

Test cases 14§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 5
Other tests reaching this symbol 9

Relations§

Instantiated in 2
Static calls 2
Method calls 2