InteractsWithExceptionHandling
trait InteractsWithExceptionHandling
Traits
Properties
| protected ExceptionHandler|null | $originalExceptionHandler | The original exception handler. |
Methods
Get the class name of the first parameter of the given Closure.
Get the class names of the first parameter of the given Closure, including union types.
Get the class names / types of the parameters of the given Closure.
Get the class names / types of the return type of the given Closure.
Restore exception handling.
Only handle the given exceptions via the exception handler.
Only handle validation exceptions via the exception handler.
Disable exception handling for the test.
Create a new exception handler instance.
Register a callback to be called after an HTTP error response is rendered.
Details
in
ReflectsClosures at line 26
protected string
firstClosureParameterType(Closure $closure)
Get the class name of the first parameter of the given Closure.
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.
in
ReflectsClosures at line 75
protected array
closureParameterTypes(Closure $closure)
Get the class names / types of the parameters of the given Closure.
in
ReflectsClosures at line 97
protected array
closureReturnTypes(Closure $closure)
Get the class names / types of the return type of the given Closure.
at line 33
protected InteractsWithExceptionHandling
withExceptionHandling()
Restore exception handling.
at line 51
protected InteractsWithExceptionHandling
handleExceptions(array $exceptions)
Only handle the given exceptions via the exception handler.
at line 59
protected InteractsWithExceptionHandling
handleValidationExceptions()
Only handle validation exceptions via the exception handler.
at line 69
protected InteractsWithExceptionHandling
withoutExceptionHandling(array $except = [])
Disable exception handling for the test.
at line 85
__construct(ExceptionHandler $originalHandler, array $except = [])
Create a new exception handler instance.
at line 97
void
report(Throwable $e, array $context = [], string|null $level = null)
Report or log an exception.
at line 104
bool
shouldReport(Throwable $e)
Determine if the exception should be reported.
at line 114
Response
render(Request $request, Throwable $e)
Render an exception into an HTTP response.
at line 136
void
renderForConsole(OutputInterface $output, Throwable $e)
Render an exception to the console.
at line 144
bool
isReporting(Throwable $e)
Determine if a given exception is being reported.
at line 154
array
buildContextForException(Throwable $e)
Create the context for an exception.
at line 163
void
afterResponse(callable $callback)
Register a callback to be called after an HTTP error response is rendered.