class ReportableHandler

Traits

Properties

protected callable $callback

The underlying callback.

protected bool $shouldStop

Indicates if reporting should stop after invoking this handler.

Methods

string
firstClosureParameterType(Closure $closure)

Get the class name of the first parameter of the given Closure.

array
firstClosureParameterTypes(Closure $closure)

Get the class names of the first parameter of the given Closure, including union types.

array
closureParameterTypes(Closure $closure)

Get the class names / types of the parameters of the given Closure.

array
closureReturnTypes(Closure $closure)

Get the class names / types of the return type of the given Closure.

__construct(callable $callback)

Create a new reportable handler instance.

bool
__invoke(Throwable $e, array $context = [])

Invoke the handler.

bool
handles(Throwable $e)

Determine if the callback handles the given exception.

stop()

Indicate that report handling should stop after invoking this callback.

Details

in ReflectsClosures at line 26
protected string firstClosureParameterType(Closure $closure)

Get the class name of the first parameter of the given Closure.

Parameters

Closure $closure

Return Value

string

Exceptions

ReflectionException
RuntimeException

in ReflectsClosures at line 49
protected array firstClosureParameterTypes(Closure $closure)

Get the class names of the first parameter of the given Closure, including union types.

Parameters

Closure $closure

Return Value

array

Exceptions

ReflectionException
RuntimeException

in ReflectsClosures at line 75
protected array closureParameterTypes(Closure $closure)

Get the class names / types of the parameters of the given Closure.

Parameters

Closure $closure

Return Value

array

Exceptions

ReflectionException

in ReflectsClosures at line 97
protected array closureReturnTypes(Closure $closure)

Get the class names / types of the return type of the given Closure.

Parameters

Closure $closure

Return Value

array

Exceptions

ReflectionException

at line 29
__construct(callable $callback)

Create a new reportable handler instance.

Parameters

callable $callback

at line 39
bool __invoke(Throwable $e, array $context = [])

Invoke the handler.

Parameters

Throwable $e
array $context

Return Value

bool

at line 53
bool handles(Throwable $e)

Determine if the callback handles the given exception.

Parameters

Throwable $e

Return Value

bool

at line 72
ReportableHandler stop()

Indicate that report handling should stop after invoking this callback.

Boot-only. The flag persists on the registered callback and stops report handling for every exception it subsequently handles in the worker.

Return Value

ReportableHandler