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\AutoInstrumentationView 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 |