classSnapshotValidation
final class SnapshotValidation
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Validates persistence data before it can affect cumulative measurements.
Type Aliases§
Snapshot = import from GrammarCoverageHistory = import from GrammarCoverageMethods§
public function decode(string $json): HistoryReads saved identity and production sets while rejecting corrupt JSON.
Parameters
$json | string |
Returns
Throws
CoverageException When JSON or required fields are invalidTest cases 4
Called from 1
Calls 8
- function-call
json_decodeline 28 - new CoverageException line 30
- function-call
is_arrayline 32 - function-call
is_stringline 36 - function-call
array_is_listline 45 - function-call
countline 46 - function-call
array_filterline 46 - method-call SnapshotValidation::checkpoint() line 50
public function checkpoint(stdClass $checkpoint): boolValidates diagnostic fields without treating past counters as current observations.
Parameters
$checkpoint | stdClass |
Returns
boolTest cases 1
Called from 1
public function compatible(
History $incoming,
Snapshot $expected,
GrammarCoverageInventory $inventory,
): voidRejects mismatched histories and IDs outside the reconstructed inventory.
Parameters
$incoming | History | |
$expected | Snapshot | |
$inventory | GrammarCoverageInventory |
Throws
CoverageException When history cannot be merged safelyTest cases 4
SnapshotValidationTest::testCompatibleRejectsAnUntrustedInventoryDigestcallsSnapshotValidationTest::testCompatibleRejectsEmittedProductionsThatWereNeverReachedcallsSnapshotValidationTest::testCompatibleRejectsUnknownProductionIdscallsSnapshotValidationTest::testCompatibleRequiresEveryIdentityComponentcalls
Called from 1
Calls 3
- new CoverageException line 80
- function-call
array_diffline 84 - function-call
array_keysline 84
Test cases 14§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 9
SnapshotValidationTest::testCheckpointRequiresTypedDiagnosticFieldscallsSnapshotValidationTest::testCompatibleRejectsAnUntrustedInventoryDigestcallsSnapshotValidationTest::testCompatibleRejectsEmittedProductionsThatWereNeverReachedcallsSnapshotValidationTest::testCompatibleRejectsUnknownProductionIdscallsSnapshotValidationTest::testCompatibleRequiresEveryIdentityComponentcallsSnapshotValidationTest::testDecodeRejectsAnUnknownFormatVersioncallsSnapshotValidationTest::testDecodeRejectsCorruptJsonInsteadOfStartingEmptyHistorycallsSnapshotValidationTest::testDecodeRejectsMalformedHistoryFieldscallsSnapshotValidationTest::testDecodeRestoresOnlyWellFormedSnapshotDatacalls
Other tests reaching this symbol 5
ByteChoicesTestcallsCoverageSnapshotStoreTestcallsGrammarCoverageInventoryTestcallsGrammarCoverageTestcallsDerivationNodeTestcalls