diff options
Diffstat (limited to 'vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ScopeManager.php')
-rw-r--r-- | vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ScopeManager.php | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ScopeManager.php b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ScopeManager.php new file mode 100644 index 000000000..eb5c27676 --- /dev/null +++ b/vendor/jonahgeorge/jaeger-client-php/src/Jaeger/ScopeManager.php @@ -0,0 +1,45 @@ +<?php + +namespace Jaeger; + +use OpenTracing\ScopeManager as OTScopeManager; +use OpenTracing\Span as OTSpan; +use OpenTracing\Scope as OTScope; + +/** + * {@inheritdoc} + */ +class ScopeManager implements OTScopeManager +{ + /** + * @var OTScope + */ + private $active; + + /** + * {@inheritdoc} + */ + public function activate(OTSpan $span, bool $finishSpanOnClose = self::DEFAULT_FINISH_SPAN_ON_CLOSE): OTScope + { + $this->active = new Scope($this, $span, $finishSpanOnClose); + + return $this->active; + } + + /** + * {@inheritdoc} + */ + public function getActive(): ?OTScope + { + return $this->active; + } + + /** + * Sets the scope as active. + * @param OTScope|null $scope + */ + public function setActive(OTScope $scope = null) + { + $this->active = $scope; + } +} |