entries = $repo->entries($snapshotId); $this->current = $this->entries->valid() ? $this->entries->current() : null; while ($this->consumed < $skip && $this->current !== null) { $this->advance(); } } /** @return array{p:string, s:int, m:int, b:list}|null */ public function find(string $path): ?array { while ($this->current !== null) { $c = TreeWalker::compare($this->current['p'], $path); if ($c === 0) { return $this->current; } if ($c > 0) { return null; } $this->advance(); } return null; } public function position(): int { return $this->consumed; } private function advance(): void { $this->entries->next(); $this->consumed++; $this->current = $this->entries->valid() ? $this->entries->current() : null; } }