summaryrefslogtreecommitdiff
path: root/vendor/opentracing/opentracing/src/OpenTracing/NoopSpanContext.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/opentracing/opentracing/src/OpenTracing/NoopSpanContext.php')
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/NoopSpanContext.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/vendor/opentracing/opentracing/src/OpenTracing/NoopSpanContext.php b/vendor/opentracing/opentracing/src/OpenTracing/NoopSpanContext.php
new file mode 100644
index 000000000..5b0de7c93
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/NoopSpanContext.php
@@ -0,0 +1,35 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+use EmptyIterator;
+use Traversable;
+
+final class NoopSpanContext implements SpanContext
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function getIterator(): Traversable
+ {
+ return new EmptyIterator();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getBaggageItem(string $key): ?string
+ {
+ return null;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function withBaggageItem(string $key, string $value): SpanContext
+ {
+ return new self();
+ }
+}