ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Whoops\Handler\CallbackHandler Class Reference

Wrapper for Closures passed as handlers. More...

+ Inheritance diagram for Whoops\Handler\CallbackHandler:
+ Collaboration diagram for Whoops\Handler\CallbackHandler:

Public Member Functions

 __construct ($callable)
 
 handle ()
 
- Public Member Functions inherited from Whoops\Handler\Handler
 setRun (RunInterface $run)
 
 setInspector (Inspector $inspector)
 
 setException ($exception)
 

Protected Attributes

 $callable
 

Additional Inherited Members

- Data Fields inherited from Whoops\Handler\Handler
const DONE = 0x10
 
const LAST_HANDLER = 0x20
 The Handler has handled the Throwable in some way, and wishes to skip any other Handler. More...
 
const QUIT = 0x30
 The Handler has handled the Throwable in some way, and wishes to quit/stop execution. More...
 
- Protected Member Functions inherited from Whoops\Handler\Handler
 getRun ()
 
 getInspector ()
 
 getException ()
 

Detailed Description

Wrapper for Closures passed as handlers.

Can be used directly, or will be instantiated automagically by Whoops if passed to Run::pushHandler

Definition at line 16 of file CallbackHandler.php.

Constructor & Destructor Documentation

◆ __construct()

Whoops\Handler\CallbackHandler::__construct (   $callable)
Exceptions
InvalidArgumentExceptionIf argument is not callable
Parameters
callable$callable

Definition at line 27 of file CallbackHandler.php.

References Whoops\Handler\CallbackHandler\$callable.

28  {
29  if (!is_callable($callable)) {
30  throw new InvalidArgumentException(
31  'Argument to ' . __METHOD__ . ' must be valid callable'
32  );
33  }
34 
35  $this->callable = $callable;
36  }

Member Function Documentation

◆ handle()

Whoops\Handler\CallbackHandler::handle ( )
Returns
int|null

Implements Whoops\Handler\HandlerInterface.

Definition at line 41 of file CallbackHandler.php.

References Whoops\Handler\CallbackHandler\$callable, Whoops\Handler\Handler\$exception, Whoops\Handler\Handler\$inspector, Whoops\Handler\Handler\$run, Whoops\Handler\Handler\getException(), Whoops\Handler\Handler\getInspector(), and Whoops\Handler\Handler\getRun().

42  {
43  $exception = $this->getException();
44  $inspector = $this->getInspector();
45  $run = $this->getRun();
47 
48  // invoke the callable directly, to get simpler stacktraces (in comparison to call_user_func).
49  // this assumes that $callable is a properly typed php-callable, which we check in __construct().
51  }
+ Here is the call graph for this function:

Field Documentation

◆ $callable

Whoops\Handler\CallbackHandler::$callable
protected

The documentation for this class was generated from the following file: