Skip to content

ArtifactDriftChecker

gofmt-style drift check: does the committed file at $target already match what we’d emit right now?

Never writes anything — a future CLI’s --check mode is exactly “emit, checkDrift, exit non-zero on mismatch”.

final class ArtifactDriftChecker

Since1.0.0
SourceSupport/Compiler/ArtifactDriftChecker.php
MethodDescription
check(EmittedArtifact $artifact, string $target): ArtifactDriftResultCompares a freshly emitted artifact against the file currently at $target.

public function check(EmittedArtifact $artifact, string $target): ArtifactDriftResult

Compares a freshly emitted artifact against the file currently at $target.

A missing target, or one that cannot be read, counts as drift with a null existing checksum; otherwise the result is in sync when the SHA-256 of the file on disk equals the artifact’s checksum. Nothing is written.

ParameterTypeDescription
$artifactEmittedArtifact
$targetstring

Returns ArtifactDriftResult