classByteChoices
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
$bytes | string |
public function index(int $count): ?intReturns a choice, or null when a complete choice is unavailable.
Parameters
$count | int |
Returns
?intThrows
InvalidArgumentException When the candidate count is not positiveTest cases 3
ByteChoicesTest::testIndexConsumesLittleEndianChoicesWiderThanOneBytecovers and callsByteChoicesTest::testIndexDoesNotUseAnIncompleteChoicecovers and callsByteChoicesTest::testIndexReducesUnsignedEightByteValuesWithoutIntegerOverflowcovers and calls
Called from 2
Calls 3
- static-call ByteChoices::width() line 32
- function-call
strlenline 33 - function-call
ordline 39
public static function width(int $count): intCounts the little-endian bytes used by both encoder and decoder.
Parameters
$count | int |
Returns
intThrows
InvalidArgumentException When the candidate count is not positiveTest cases 4
ByteChoicesTest::testIndexConsumesLittleEndianChoicesWiderThanOneBytecoversByteChoicesTest::testIndexDoesNotUseAnIncompleteChoicecoversByteChoicesTest::testIndexReducesUnsignedEightByteValuesWithoutIntegerOverflowcoversByteChoicesTest::testWidthUsesTheMinimumNumberOfBytesWithoutAssuming256Alternativescovers and calls
Called from 1
Private surface 2§
Implementation details, listed for orientation only.
private int $position = 0private string $bytesTest cases 12§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
ByteChoicesTest::testIndexConsumesLittleEndianChoicesWiderThanOneBytecovers and callsByteChoicesTest::testIndexDoesNotUseAnIncompleteChoicecovers and callsByteChoicesTest::testIndexReducesUnsignedEightByteValuesWithoutIntegerOverflowcovers and callsByteChoicesTest::testWidthUsesTheMinimumNumberOfBytesWithoutAssuming256Alternativescovers and calls
Other tests reaching this symbol 8
BytePlanCompilerTestcallsPlanBuilderTestcallsCoverageSnapshotStoreTestcallsGrammarCoverageInventoryTestcallsGrammarCoverageTestcallsSnapshotValidationTestcallsDerivationNodeTestcallsSqlGeneratorTestcalls