ExplicitKeyIndex
The zero-dependency, always-works fallback: a key pasted straight out of a pointer log line, fetched from the object store directly.
Declines (returns null) when --key was not given — this index has nothing to try without one — but a given key that does not resolve to a real object is a genuine failure, since the developer pointed at a specific location expecting it to exist.
Synopsis
Section titled “Synopsis”final readonly class ExplicitKeyIndex implements CassetteIndexInterface
| Implements | CassetteIndexInterface |
| Source | Index/ExplicitKeyIndex.php |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(ObjectStoreClientInterface $client, CassetteCodec $codec = new CassetteCodec(…)): mixed
| Parameter | Type | Description |
|---|---|---|
$client | ObjectStoreClientInterface | |
$codec | CassetteCodec |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
resolve(CassetteId $id, IndexHints $hints): ?Cassette | Returns null when this index has nothing to try for the given id/hints — not configured, no matching hint present, or a legitimate zero-result lookup. |
resolve()
Section titled “resolve()”public function resolve(CassetteId $id, IndexHints $hints): ?Cassette
Returns null when this index has nothing to try for the given id/hints — not configured, no matching hint present, or a legitimate zero-result lookup.
That is the designed “try the next index in the chain” signal, not an error. A genuine failure (a malformed hint, a broken query, an auth error, or a pointer whose payload has already expired) throws CassetteIndexException instead, so a misconfigured or broken index never masquerades as “not found here.”
| Parameter | Type | Description |
|---|---|---|
$id | CassetteId | |
$hints | IndexHints |
Returns ?Cassette