From 884fd92f1320d17daebb772297da03fb2cfa59b8 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 1 Oct 2024 16:00:34 +0300 Subject: drop opentelemetry --- .../api/Instrumentation/CachedInstrumentation.php | 97 ---------------------- 1 file changed, 97 deletions(-) delete mode 100644 vendor/open-telemetry/api/Instrumentation/CachedInstrumentation.php (limited to 'vendor/open-telemetry/api/Instrumentation/CachedInstrumentation.php') diff --git a/vendor/open-telemetry/api/Instrumentation/CachedInstrumentation.php b/vendor/open-telemetry/api/Instrumentation/CachedInstrumentation.php deleted file mode 100644 index 5ffb3950d..000000000 --- a/vendor/open-telemetry/api/Instrumentation/CachedInstrumentation.php +++ /dev/null @@ -1,97 +0,0 @@ -|null */ - private ?ArrayAccess $tracers; - /** @var ArrayAccess|null */ - private ?ArrayAccess $meters; - /** @var ArrayAccess|null */ - private ?ArrayAccess $loggers; - - public function __construct(string $name, ?string $version = null, ?string $schemaUrl = null, iterable $attributes = []) - { - $this->name = $name; - $this->version = $version; - $this->schemaUrl = $schemaUrl; - $this->attributes = $attributes; - $this->tracers = self::createWeakMap(); - $this->meters = self::createWeakMap(); - $this->loggers = self::createWeakMap(); - } - - private static function createWeakMap(): ?ArrayAccess - { - if (PHP_VERSION_ID < 80000) { - return null; - } - - /** @phan-suppress-next-line PhanUndeclaredClassReference */ - assert(class_exists(\WeakMap::class, false)); - /** @phan-suppress-next-line PhanUndeclaredClassMethod */ - $map = new \WeakMap(); - assert($map instanceof ArrayAccess); - - return $map; - } - - public function tracer(): TracerInterface - { - $tracerProvider = Globals::tracerProvider(); - - if ($this->tracers === null) { - return $tracerProvider->getTracer($this->name, $this->version, $this->schemaUrl, $this->attributes); - } - - return $this->tracers[$tracerProvider] ??= $tracerProvider->getTracer($this->name, $this->version, $this->schemaUrl, $this->attributes); - } - - public function meter(): MeterInterface - { - $meterProvider = Globals::meterProvider(); - - if ($this->meters === null) { - return $meterProvider->getMeter($this->name, $this->version, $this->schemaUrl, $this->attributes); - } - - return $this->meters[$meterProvider] ??= $meterProvider->getMeter($this->name, $this->version, $this->schemaUrl, $this->attributes); - } - public function logger(): LoggerInterface - { - $loggerProvider = Globals::loggerProvider(); - - if ($this->loggers === null) { - return $loggerProvider->getLogger($this->name, $this->version, $this->schemaUrl, $this->attributes); - } - - return $this->loggers[$loggerProvider] ??= $loggerProvider->getLogger($this->name, $this->version, $this->schemaUrl, $this->attributes); - } -} -- cgit v1.2.3-54-g00ecf