We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cede402 commit a1f2200Copy full SHA for a1f2200
2 files changed
src/Tracer/InjectableInterface.php
@@ -8,4 +8,6 @@
8
interface InjectableInterface
9
{
10
public function assign(SpanContext $context): InjectableInterface;
11
+
12
+ public function remove(SpanContext $context) : InjectableInterface;
13
}
src/Tracer/Tracer.php
@@ -58,6 +58,21 @@ public function assign(SpanContext $context): InjectableInterface
58
return $this;
59
60
61
+ public function remove(SpanContext $context): InjectableInterface
62
+ {
63
+ if (0 === $this->stack->count()) {
64
+ return $this;
65
+ }
66
67
+ if (spl_object_hash($this->stack->top()) !== spl_object_hash($context)) {
68
+ throw new \LogicException('Current context is different');
69
70
+ $this->stack->pop();
71
72
73
74
75
76
public function getClient(): ClientInterface
77
78
return $this->client;
0 commit comments