Skip to content

Commit

Permalink
Merge pull request #117 from opentracing/fixes_with_baggage_items
Browse files Browse the repository at this point in the history
fix: fixes the return type for withBaggageItems.
  • Loading branch information
jcchavezs authored Jan 5, 2021
2 parents d2466a2 + 450cfd9 commit 31d2604
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/OpenTracing/Mock/MockSpanContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace OpenTracing\Mock;

use ArrayIterator;
use OpenTracing\SpanContext;
use ArrayIterator;

final class MockSpanContext implements SpanContext
{
Expand Down Expand Up @@ -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]));
}
Expand Down
2 changes: 1 addition & 1 deletion src/OpenTracing/NoopSpanContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/OpenTracing/SpanContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 31d2604

Please sign in to comment.