summaryrefslogtreecommitdiff
path: root/vendor/opentracing/opentracing/src/OpenTracing/InvalidReferenceArgumentException.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2023-04-09 20:50:33 +0300
committerAndrew Dolgov <[email protected]>2023-04-09 20:50:33 +0300
commit8f3646a9c93a06f76f6abb31020fdb74b4b1fc59 (patch)
tree4e6c9f39e0623ef70bedfee014f1bd20603f89ad /vendor/opentracing/opentracing/src/OpenTracing/InvalidReferenceArgumentException.php
parenta37eab2610a0a2bcb655258781c1c7e925dc94c0 (diff)
exp: jaeger tracing
Diffstat (limited to 'vendor/opentracing/opentracing/src/OpenTracing/InvalidReferenceArgumentException.php')
-rw-r--r--vendor/opentracing/opentracing/src/OpenTracing/InvalidReferenceArgumentException.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/vendor/opentracing/opentracing/src/OpenTracing/InvalidReferenceArgumentException.php b/vendor/opentracing/opentracing/src/OpenTracing/InvalidReferenceArgumentException.php
new file mode 100644
index 000000000..128360393
--- /dev/null
+++ b/vendor/opentracing/opentracing/src/OpenTracing/InvalidReferenceArgumentException.php
@@ -0,0 +1,33 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OpenTracing;
+
+use InvalidArgumentException;
+
+/**
+ * Thrown when passing an invalid argument for a reference
+ */
+final class InvalidReferenceArgumentException extends InvalidArgumentException
+{
+ /**
+ * @return InvalidReferenceArgumentException
+ */
+ public static function forEmptyType(): InvalidReferenceArgumentException
+ {
+ return new self('Reference type can not be an empty string');
+ }
+
+ /**
+ * @param mixed $context
+ * @return InvalidReferenceArgumentException
+ */
+ public static function forInvalidContext($context): InvalidReferenceArgumentException
+ {
+ return new self(sprintf(
+ 'Reference expects \OpenTracing\Span or \OpenTracing\SpanContext as context, got %s',
+ is_object($context) ? get_class($context) : gettype($context)
+ ));
+ }
+}