Skip to content

Commit f51565e

Browse files
committed
Renamed debug tag to debug
1 parent 20beb12 commit f51565e

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

src/Tracer/ResettableInterface.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
namespace Jaeger\Tracer;
5+
6+
interface ResettableInterface
7+
{
8+
public function reset(): ResettableInterface;
9+
}

src/Tracer/Tracer.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Tracer implements TracerInterface,
1313
ContextAwareInterface,
1414
InjectableInterface,
1515
FlushableInterface,
16+
ResettableInterface,
1617
DebuggableInterface
1718
{
1819
private $stack;
@@ -58,21 +59,26 @@ public function assign(SpanContext $context): InjectableInterface
5859
return $this;
5960
}
6061

62+
public function reset(): ResettableInterface
63+
{
64+
$this->stack = new \SplStack();
65+
66+
return $this;
67+
}
68+
6169
public function remove(SpanContext $context): InjectableInterface
6270
{
6371
while ($this->stack->valid()) {
6472
if (spl_object_hash($this->stack->top()) !== spl_object_hash($context)) {
6573
$this->stack->pop();
6674
continue;
6775
}
68-
6976
break;
7077
}
7178

7279
return $this;
7380
}
7481

75-
7682
public function getClient(): ClientInterface
7783
{
7884
return $this->client;
@@ -103,7 +109,6 @@ public function getContext(SpanContext $userContext = null): ?SpanContext
103109
if (null !== $userContext) {
104110
return $userContext;
105111
}
106-
107112
if (0 !== $this->stack->count()) {
108113
return $this->stack->top();
109114
}

0 commit comments

Comments
 (0)