function FiberBoundContextStorageExecutionAwareBC::bcStorage
File
-
vendor/
open-telemetry/ context/ FiberBoundContextStorageExecutionAwareBC.php, line 35
Class
- FiberBoundContextStorageExecutionAwareBC
- @internal
Namespace
OpenTelemetry\ContextCode
private function bcStorage() : ContextStorage {
if ($this->bc === null) {
$this->bc = new ContextStorage();
// Copy head into $this->bc storage to preserve already attached scopes
/** @psalm-suppress PossiblyNullFunctionCall */
$head = (static fn($storage) => $storage->heads[$storage])
->bindTo(null, FiberBoundContextStorage::class)($this->storage);
$head->storage = $this->bc;
/** @psalm-suppress PossiblyNullFunctionCall */
(static fn($storage) => $storage->current = $storage->main = $head)
->bindTo(null, ContextStorage::class)($this->bc);
}
return $this->bc;
}