InteractsWithExceptionHandling
trait InteractsWithExceptionHandling (View source)
Traits
Properties
protected ExceptionHandler|null | $originalExceptionHandler | The original exception handler. |
|
protected | $except | ||
protected | $originalHandler |
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.
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.
Details
protected string
firstClosureParameterType(Closure $closure)
Get the class name of the first parameter of the given Closure.
protected array
firstClosureParameterTypes(Closure $closure)
Get the class names of the first parameter of the given Closure, including union types.
protected array
closureParameterTypes(Closure $closure)
Get the class names / types of the parameters of the given Closure.
protected $this
withExceptionHandling()
Restore exception handling.
protected $this
handleExceptions(array $exceptions)
Only handle the given exceptions via the exception handler.
protected $this
handleValidationExceptions()
Only handle validation exceptions via the exception handler.
protected $this
withoutExceptionHandling(array $except = [])
Disable exception handling for the test.
void
__construct(ExceptionHandler $originalHandler, array $except = [])
Create a new class instance.
void
report(Throwable $e)
Report or log an exception.
bool
shouldReport(Throwable $e)
Determine if the exception should be reported.
void
renderForConsole(OutputInterface $output, Throwable $e)
Render an exception to the console.