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 30
SnapshotValidationTest::testDecodeRejectsAnUnknownFormatVersioncovers and callsSnapshotValidationTest::testDecodeRejectsCorruptJsonInsteadOfStartingEmptyHistorycovers and callsSnapshotValidationTest::testDecodeRejectsMalformedHistoryFieldscallsSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#0coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#1coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#10coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#11coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#12coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#13coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#14coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#15coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#16coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#17coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#18coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#19coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#2coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#20coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#21coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#22coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#23coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#24coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#25coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#3coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#4coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#5coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#6coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#7coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#8coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#9coversSnapshotValidationTest::testDecodeRestoresOnlyWellFormedSnapshotDatacovers and calls
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 6
SnapshotValidationTest::testCheckpointRequiresTypedDiagnosticFieldscovers and callsSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#22coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#23coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#24coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#25coversSnapshotValidationTest::testDecodeRestoresOnlyWellFormedSnapshotDatacovers
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 8
SnapshotValidationTest::testCompatibleRejectsAnUntrustedInventoryDigestcovers and callsSnapshotValidationTest::testCompatibleRejectsEmittedProductionsThatWereNeverReachedcovers and callsSnapshotValidationTest::testCompatibleRejectsUnknownProductionIdscovers and callsSnapshotValidationTest::testCompatibleRequiresEveryIdentityComponentcallsSnapshotValidationTest::testCompatibleRequiresEveryIdentityComponent#0coversSnapshotValidationTest::testCompatibleRequiresEveryIdentityComponent#1coversSnapshotValidationTest::testCompatibleRequiresEveryIdentityComponent#2coversSnapshotValidationTest::testCompatibleRequiresEveryIdentityComponent#3covers
Called from 1
Calls 3
- new CoverageException line 80
- function-call
array_diffline 84 - function-call
array_keysline 84
Test cases 44§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 39
SnapshotValidationTest::testCheckpointRequiresTypedDiagnosticFieldscovers and callsSnapshotValidationTest::testCompatibleRejectsAnUntrustedInventoryDigestcovers and callsSnapshotValidationTest::testCompatibleRejectsEmittedProductionsThatWereNeverReachedcovers and callsSnapshotValidationTest::testCompatibleRejectsUnknownProductionIdscovers and callsSnapshotValidationTest::testCompatibleRequiresEveryIdentityComponentcallsSnapshotValidationTest::testCompatibleRequiresEveryIdentityComponent#0coversSnapshotValidationTest::testCompatibleRequiresEveryIdentityComponent#1coversSnapshotValidationTest::testCompatibleRequiresEveryIdentityComponent#2coversSnapshotValidationTest::testCompatibleRequiresEveryIdentityComponent#3coversSnapshotValidationTest::testDecodeRejectsAnUnknownFormatVersioncovers and callsSnapshotValidationTest::testDecodeRejectsCorruptJsonInsteadOfStartingEmptyHistorycovers and callsSnapshotValidationTest::testDecodeRejectsMalformedHistoryFieldscallsSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#0coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#1coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#10coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#11coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#12coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#13coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#14coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#15coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#16coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#17coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#18coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#19coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#2coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#20coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#21coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#22coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#23coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#24coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#25coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#3coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#4coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#5coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#6coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#7coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#8coversSnapshotValidationTest::testDecodeRejectsMalformedHistoryFields#9coversSnapshotValidationTest::testDecodeRestoresOnlyWellFormedSnapshotDatacovers and calls
Other tests reaching this symbol 5
ByteChoicesTestcallsCoverageSnapshotStoreTestcallsGrammarCoverageInventoryTestcallsGrammarCoverageTestcallsDerivationNodeTestcalls