*/ final class PrivateIterator implements Iterator { /** @var Producer */ private Producer $producer; /** * @param Producer $producer * * @psalm-param Iterator $iterator */ public function __construct(Producer $producer) { $this->producer = $producer; } /** * @return Promise */ public function advance(): Promise { return $this->producer->advance(); } /** * @psalm-return TValue */ public function getCurrent() { return $this->producer->getCurrent(); } }