buildPropagator($propagators[0]); default: return new MultiTextMapPropagator($this->buildPropagators($propagators)); } } /** * @return array */ private function buildPropagators(array $names): array { $propagators = []; foreach ($names as $name) { $propagators[] = $this->buildPropagator($name); } return $propagators; } private function buildPropagator(string $name): TextMapPropagatorInterface { try { return Registry::textMapPropagator($name); } catch (\RuntimeException $e) { self::logWarning($e->getMessage()); } return NoopTextMapPropagator::getInstance(); } }