From 450cfd9c36a4ec530847619b40715b980ba870fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Ch=C3=A1vez?= Date: Tue, 5 Jan 2021 06:42:38 +0100 Subject: [PATCH] fix: fixes the return type for withBaggageItems. --- src/OpenTracing/Mock/MockSpanContext.php | 4 ++-- src/OpenTracing/NoopSpanContext.php | 2 +- src/OpenTracing/SpanContext.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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; }