class Scope

This class in an implementation of a generic scope that has something to execute when the scope finishes.

Example:

$scope = RequestTracer::withSpan($span);
try {
  return do_something();
} finally {
  $scope->close();
}

Methods

__construct(callable $callback, array $args = [])

Creates a new Scope

close()

Close and clean up the scope. Runs the initial callback provided.

Details

at line 52
__construct(callable $callback, array $args = [])

Creates a new Scope

Parameters

callable $callback
array $args

at line 61
close()

Close and clean up the scope. Runs the initial callback provided.