{@inheritdoc}

@see \Jaeger\Tracer::inject

@param SpanContext $spanContext
@param mixed $carrier

@return void
972219
public function inject(SpanContext $spanContext, &$carrier)
    {
        $carrier[self::TRACE_ID_NAME] = dechex($spanContext->getTraceId());
        $carrier[self::SPAN_ID_NAME] = dechex($spanContext->getSpanId());
        if ($spanContext->getParentId() != null) {
            $carrier[self::PARENT_ID_NAME] = dechex($spanContext->getParentId());
        }
        $carrier[self::FLAGS_NAME] = (int) $spanContext->getFlags();
    }
608996
def inject(cls, span, obj):
        
        obj.metadata['__parent-span__'] = dict()
        cls.inject_span(span, obj.metadata['__parent-span__'])
852402
public static void propagateTracingContext(Span span, HttpHeaders headers) {
    Preconditions.checkArgument(span != null, "span should not be null.");
    Preconditions.checkArgument(headers != null, "headers should not be null.");
    if (propagationTextFormat != null && propagationTextFormatSetter != null) {
      if (!span.equals(BlankSpan.INSTANCE)) {
        propagationTextFormat.inject(span.getContext(), headers, propagationTextFormatSetter);
      }
    }
  }
599132
public function extract($format, $carrier){
        if($format == Formats\TEXT_MAP){
            return $this->propagator->extract($format, $carrier);
        }else{
            throw new \Exception("not support format");
        }
    }
489644
public function newProvider(\ReflectionClass $provider, string $context) : DependencyProvider
    {
        $dependency = $this->newAnnotatedDependency($provider);

        return new DependencyProvider($dependency, $context);
    }
162394
public function inject(OTSpanContext $spanContext, $format, &$carrier)
    {
        if ($spanContext instanceof SpanContext) {
            $codec = $this->codecs[$format] ?? null;

            if ($codec == null) {
                throw UnsupportedFormat::forFormat(is_scalar($format) ? $format : gettype($format));
            }


            $codec->inject($spanContext, $carrier);
            return;
        }

        $message = sprintf(
            'Invalid span context. Expected Jaeger\SpanContext, got %s.',
            is_object($spanContext) ? get_class($spanContext) : gettype($spanContext)
        );

        $this->logger->warning($message);
    }
219184
private function spanContextToString($traceId, $spanId, $parentId, $flags)
    {
        $parentId = $parentId ?? 0;
        return sprintf('%x:%x:%x:%x', $traceId, $spanId, $parentId, $flags);
    }
817543
public function inject(SpanContext $spanContext, $format, &$carrier){
        if($format == Formats\TEXT_MAP){
            $this->propagator->inject($spanContext, $format, $carrier);
        }else{
            throw new \Exception("not support format");
        }
    }
70667
@VisibleForTesting
  static void register(final SpanExporter spanExporter, final SpanExporter.Handler handler) {
    spanExporter.registerHandler(REGISTER_NAME, handler);
  }
321608
public function createInjection(\ReflectionClass $class, string $context = null)
    {
        if ($class->isSubclassOf(ClassesInterface::class)) {
            return $this->classLocator();
        } elseif ($class->isSubclassOf(InvocationsInterface::class)) {
            return $this->invocationLocator();
        }

        throw new InjectionException("Unable to create injection for {$class}");
    }
22703
public function execute(MappingContext $context)
	{
		$typeMap = $this->config->findTypeMap($context->getSourceType(), $context->getDestinationType());

		try {
			$typeMap->validate();
			$mapFunc = $typeMap->getMapFunc();

			$destination = is_array($context->getSource())
				? $this->mapCollection($context, $mapFunc)
				: $this->mapObject($context, $mapFunc);
			return $destination;
		} catch (\Exception $e) {
			$message = sprintf("Error while mapping %s -> %s", $typeMap->getSourceType(), $typeMap->getDestinationType());
			throw new MappingException($message, 0, $e);
		}
	}
832379
public function adjust(Carrier $carrier = null) {
    // If there's carrier
    if ($carrier !== null) {
      // Set carrier
      $this->carrier = $carrier;
    }
    // If there's no carrier
    if ( ! isset($this->carrier)) {
      // Throw error
      throw new MissingCarrier('Carrier is required to adjust cost');
    }
    // Get costs
    $costs = $this->getPossibleCostsPerCarrier()[$this->carrier->network];
    // Loop through costs per carrier
    foreach ($costs as $i=> $cost) {
      // If cost equals
      if ($this->amount == $cost) {
        // Quit
        break;
      }
      // If amount is less than cost
      if ($this->amount < $cost || ! isset($costs[$i + 1])) {
        // Use previous
        $this->amount = $cost;
        // Break
        break;
      }
    }
    // Return self
    return $this;
  }
1171164
private function initializeInstance(Context $context)
    {
        foreach ($this->contextInitializers as $initializer) {
            $initializer->initializeContext($context);
        }
    }
1087824
public static function injectFile(TemplateInterface $template, TemplateTranslationInterface $translation): void
    {
        if ($template instanceof TemplateFileInterface && $translation instanceof TemplateFileInterface) {
            /** @var TemplateInterface $template */
            /** @var TemplateTranslationInterface $translation */
            static::injectValue($template, $translation, 'file');
        }
    }
1048438
public static function spanName($project, $trace, $span)
    {
        return self::getSpanNameTemplate()->render([
            'project' => $project,
            'trace' => $trace,
            'span' => $span,
        ]);
    }
615478
public function process(ContainerBuilder $container)
    {
        $taggedServices = $container->findTaggedServiceIds(
            'elcodi.rule_context'
        );

        $contextProviders = [];
        foreach ($taggedServices as $id => $attributes) {
            $contextProviders[] = new Reference($id);
        }

        $definition = $container->getDefinition(
            'elcodi.expression_language_context_collector'
        );

        $definition->addArgument($contextProviders);
    }
887154
public function process(ContainerBuilder $container): void
    {
        $collector = $container->findDefinition('fivelab.resource.serializer.context_collector');
        $services = $container->findTaggedServiceIds('resource.serializer.collector');

        foreach ($services as $serviceId => $tags) {
            try {
                $collectorDefinition = $container->getDefinition($serviceId);
                $collectorClass = $container->getParameterBag()->resolveValue($collectorDefinition->getClass());

                if (!is_a($collectorClass, SerializationContextCollectorInterface::class, true)) {
                    throw new \RuntimeException(sprintf(
                        'The serialization context collector should implement "%s".',
                        SerializationContextCollectorInterface::class
                    ));
                }

                $collector->addMethodCall('add', [
                    new Reference($serviceId),
                ]);
            } catch (\Exception $e) {
                throw new \RuntimeException(sprintf(
                    'Can\'t compile resource serialization collector with service id "%s".',
                    $serviceId
                ), 0, $e);
            }
        }
    }