You are here

public function ErrorHandlerSubscriber::registerErrorHandler in Devel 4.x

Same name and namespace in other branches
  1. 8.3 src/EventSubscriber/ErrorHandlerSubscriber.php \Drupal\devel\EventSubscriber\ErrorHandlerSubscriber::registerErrorHandler()
  2. 8 src/EventSubscriber/ErrorHandlerSubscriber.php \Drupal\devel\EventSubscriber\ErrorHandlerSubscriber::registerErrorHandler()
  3. 8.2 src/EventSubscriber/ErrorHandlerSubscriber.php \Drupal\devel\EventSubscriber\ErrorHandlerSubscriber::registerErrorHandler()

Register devel error handler.

Parameters

\Symfony\Component\EventDispatcher\Event $event: The event to process.

File

src/EventSubscriber/ErrorHandlerSubscriber.php, line 38

Class

ErrorHandlerSubscriber
Listener for handling PHP errors.

Namespace

Drupal\devel\EventSubscriber

Code

public function registerErrorHandler(Event $event = NULL) {
  if ($this->account && $this->account
    ->hasPermission('access devel information')) {
    devel_set_handler(devel_get_handlers());
  }
}