Effect
One entry in a request’s effect ledger: a single observed side effect (a query, an HTTP call, a cache read, …), recorded in the order it happened.
$fingerprint is what LedgerMatcher matches a replayed call against first — normalized SQL plus a hash of bound parameters for a database call, method+URI+body-hash for HTTP, the key for a cache read — falling back to $seq position within the same EffectKind when no fingerprint matches. $call carries whatever a given recorder needs to describe the call beyond the fingerprint (e.g. the raw SQL and bound parameters), and $result the value playback answers with on a match.
Synopsis
Section titled “Synopsis”final readonly class Effect
| Source | Cassette/Effect.php |
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
$call | array | readonly. |
$durationMicros | ?``int | readonly. |
$fingerprint | string | readonly. |
$kind | EffectKind | readonly. |
$result | mixed | readonly. |
$seq | int | readonly. |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(non-negative-int $seq, EffectKind $kind, string $fingerprint, array<string, mixed> $call, mixed $result, non-negative-int|null $durationMicros = null): mixed
Wall time the real call took, when known.
| Parameter | Type | Description |
|---|---|---|
$seq | non-negative-int | Position in the ledger, in recorded order. |
$kind | EffectKind | |
$fingerprint | string | |
$call | array``<``string``, ``mixed``> | Recorder-specific description of the call. |
$result | mixed | |
$durationMicros | `non-negative-int“ | “null` |
Returns mixed