src/Zipkin/Propagation/CurrentTraceContext.php
public function createScopeAndRetrieveItsCloser(?TraceContext $currentContext = null): callable
    {
        $previous = $this->context;
        $self = $this;
        $this->context = $currentContext;

        return function () use ($previous, $self) {
            $self->context = $previous;
        };
    }
public function createScopeAndRetrieveItsCloser(?TraceContext $currentContext = null): callable
    {
        $previous = $this->context;
        $self = $this;
        $this->context = $currentContext;

        return function () use ($previous, $self) {
            $self->context = $previous;
        };
    }
Sets the current span in scope until the returned callable is called. It is a programming
error to drop or never close the result.

@param TraceContext|null $currentContext
@return callable The scope closed