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

Breadcrumb

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

class HookManager

Hierarchy

  • class \OpenTelemetry\API\Instrumentation\AutoInstrumentation\HookManager

Expanded class hierarchy of HookManager

1 file declares its use of HookManager
SdkAutoloader.php in vendor/open-telemetry/sdk/SdkAutoloader.php

File

vendor/open-telemetry/api/Instrumentation/AutoInstrumentation/HookManager.php, line 11

Namespace

OpenTelemetry\API\Instrumentation\AutoInstrumentation
View source
class HookManager {
    public static function enable(?ContextInterface $context = null) : ContextInterface {
        $context ??= Context::getCurrent();
        return $context->with(self::contextKey(), true);
    }
    public static function disable(?ContextInterface $context = null) : ContextInterface {
        $context ??= Context::getCurrent();
        return $context->with(self::contextKey(), false);
    }
    public static function disabled(?ContextInterface $context = null) : bool {
        $context ??= Context::getCurrent();
        return $context->get(self::contextKey()) === false;
    }
    private static function contextKey() : ContextKeyInterface {
        static $contextKey;
        return $contextKey ??= Context::createKey(self::class);
    }

}

Members

Title Sort descending Modifiers Object type Summary
HookManager::contextKey private static function
HookManager::disable public static function
HookManager::disabled public static function
HookManager::enable public static function

API Navigation

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