Skip to content

Commit 25fd60c

Browse files
Don't require a tracer.root to enable a Span (#2)
Sometimes, the Span could be called inside a coroutine, then it will not have a tracer.root on its Context.
1 parent 7bac2f6 commit 25fd60c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/SwitchManager.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ public function apply(array $config): void
3939
*/
4040
public function isEnabled(string $identifier): bool
4141
{
42-
if (! isset($this->config[$identifier])) {
43-
return false;
44-
}
45-
46-
return $this->config[$identifier] && Context::get('tracer.root') instanceof Span;
42+
return $this->config[$identifier] ?? false;
4743
}
4844
}

0 commit comments

Comments
 (0)