Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FiberBoundContextStorageExecutionAwareBC.php

function FiberBoundContextStorageExecutionAwareBC::bcStorage

File

vendor/open-telemetry/context/FiberBoundContextStorageExecutionAwareBC.php, line 35

Class

FiberBoundContextStorageExecutionAwareBC
@internal

Namespace

OpenTelemetry\Context

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal