From 8f3646a9c93a06f76f6abb31020fdb74b4b1fc59 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 9 Apr 2023 20:50:33 +0300 Subject: exp: jaeger tracing --- .../opentracing/src/OpenTracing/Reference.php | 77 ++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 vendor/opentracing/opentracing/src/OpenTracing/Reference.php (limited to 'vendor/opentracing/opentracing/src/OpenTracing/Reference.php') diff --git a/vendor/opentracing/opentracing/src/OpenTracing/Reference.php b/vendor/opentracing/opentracing/src/OpenTracing/Reference.php new file mode 100644 index 000000000..7dadf1785 --- /dev/null +++ b/vendor/opentracing/opentracing/src/OpenTracing/Reference.php @@ -0,0 +1,77 @@ +type = $type; + $this->spanContext = $spanContext; + } + + /** + * @param string $type + * @param Span $span + * @return Reference when context is invalid + * @throws InvalidReferenceArgumentException on empty type + */ + public static function createForSpan(string $type, Span $span): Reference + { + return new self($type, $span->getContext()); + } + + /** + * @return SpanContext + */ + public function getSpanContext(): SpanContext + { + return $this->spanContext; + } + + /** + * Checks whether a Reference is of one type. + * + * @param string $type the type for the reference + * @return bool + */ + public function isType(string $type): bool + { + return $this->type === $type; + } +} -- cgit v1.2.3