diff --git a/src/OpenTracing/Mock/MockSpanContext.php b/src/OpenTracing/Mock/MockSpanContext.php index 6bc13b8..d094ea0 100644 --- a/src/OpenTracing/Mock/MockSpanContext.php +++ b/src/OpenTracing/Mock/MockSpanContext.php @@ -4,8 +4,8 @@ namespace OpenTracing\Mock; -use ArrayIterator; use OpenTracing\SpanContext; +use ArrayIterator; final class MockSpanContext implements SpanContext { @@ -88,7 +88,7 @@ public function getBaggageItem(string $key): ?string /** * {@inheritdoc} */ - public function withBaggageItem(string $key, string $value): ?SpanContext + public function withBaggageItem(string $key, string $value): SpanContext { return new self($this->traceId, $this->spanId, $this->isSampled, array_merge($this->items, [$key => $value])); } diff --git a/src/OpenTracing/NoopSpanContext.php b/src/OpenTracing/NoopSpanContext.php index 8532bd2..b473412 100644 --- a/src/OpenTracing/NoopSpanContext.php +++ b/src/OpenTracing/NoopSpanContext.php @@ -27,7 +27,7 @@ public function getBaggageItem(string $key): ?string /** * {@inheritdoc} */ - public function withBaggageItem(string $key, string $value): ?SpanContext + public function withBaggageItem(string $key, string $value): SpanContext { return new self(); } diff --git a/src/OpenTracing/SpanContext.php b/src/OpenTracing/SpanContext.php index 75f1632..ca05ff9 100644 --- a/src/OpenTracing/SpanContext.php +++ b/src/OpenTracing/SpanContext.php @@ -33,5 +33,5 @@ public function getBaggageItem(string $key): ?string; * @param string $value * @return SpanContext */ - public function withBaggageItem(string $key, string $value): ?SpanContext; + public function withBaggageItem(string $key, string $value): SpanContext; }