idGenerator = $idGenerator; $this->resource = $resource; $this->spanLimits = $spanLimits; $this->sampler = $sampler; switch (count($spanProcessors)) { case 0: $this->spanProcessor = NoopSpanProcessor::getInstance(); break; case 1: $this->spanProcessor = $spanProcessors[0]; break; default: $this->spanProcessor = new MultiSpanProcessor(...$spanProcessors); break; } } public function hasShutdown(): bool { return null !== $this->shutdownResult; } public function getIdGenerator(): IdGeneratorInterface { return $this->idGenerator; } public function getResource(): ResourceInfo { return $this->resource; } public function getSpanLimits(): SpanLimits { return $this->spanLimits; } public function getSampler(): SamplerInterface { return $this->sampler; } public function getSpanProcessor(): SpanProcessorInterface { return $this->spanProcessor; } /** * Returns `false` is the provider is already shutdown, otherwise `true`. */ public function shutdown(?CancellationInterface $cancellation = null): bool { return $this->shutdownResult ?? ($this->shutdownResult = $this->spanProcessor->shutdown($cancellation)); } }