PrefixScanIndex
Reconstructs a key prefix from a --date (and, optionally, --hour) hint and enumerates it with listObjects(), needing no index service or Log Analytics access — only blob read, which makes it the right fallback for a developer who has a storage RBAC grant but not a workspace one.
Declines (returns null) when no --date hint was given; a date/hour that parses but matches nothing is also a decline, since “not recorded that day” is a legitimate outcome, not a broken index.
With only --date, the day’s hour buckets are discovered first via a delimited listing (one request returns one common prefix per hour, per CassetteKeyScheme::dayPrefix()), then each hour is scanned for a matching slug — the same “browse what happened this day” technique cassette:list itself could use against an object store, just narrowed to one id.
Synopsis
Section titled “Synopsis”final readonly class PrefixScanIndex implements CassetteIndexInterface
| Implements | CassetteIndexInterface |
| Source | Index/PrefixScanIndex.php |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(ListableObjectStoreClientInterface $client, CassetteKeyScheme $keyScheme, CassetteCodec $codec = new CassetteCodec(…)): mixed
| Parameter | Type | Description |
|---|---|---|
$client | ListableObjectStoreClientInterface | |
$keyScheme | CassetteKeyScheme | |
$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