Page MenuHomeWickedGov Phorge

StaticInjectionPropagator.php
No OneTemporary

Size
721 B
Referenced Files
None
Subscribers
None

StaticInjectionPropagator.php

<?php
namespace Wikimedia\Telemetry;
/**
* A {@link ContextPropagatorInterface} implementation that injects
* a fixed set of headers into outgoing requests. It does not perform extraction.
*
* @since 1.44
* @internal
*/
class StaticInjectionPropagator implements ContextPropagatorInterface {
private array $headers;
public function __construct( array $headers ) {
$this->headers = $headers;
}
/**
* @inheritDoc
*/
public function inject( ?SpanContext $spanContext, array $carrier ): array {
foreach ( $this->headers as $key => $value ) {
$carrier[$key] = $value;
}
return $carrier;
}
/**
* @inheritDoc
*/
public function extract( array $carrier ): ?SpanContext {
return null;
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, May 16, 17:52 (9 h, 37 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
cf/85/a13095772b5aafb681c705d8ba63
Default Alt Text
StaticInjectionPropagator.php (721 B)

Event Timeline