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, $args = [])

Creates a new Scope

close()

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

Details

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

Creates a new Scope

Parameters

callable $callback
$args

at line 60
close()

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