tenantContext->clear(); $this->identityContext->clear(); } public function markTerminated(): void { if ($this->terminated) { throw new \LogicException('The execution scope has already been terminated.'); } $this->terminated = true; } public function terminated(): bool { return $this->terminated; } public function dispose(): void { $this->identityContext->clear(); $this->tenantContext->clear(); } }