Autarky\Errors\ErrorHandlerManager::register PHP Method

register() public method

public register ( )
    public function register()
    {
        set_error_handler([$this, 'handleError']);
        if (!$this->rethrow) {
            set_exception_handler([$this, 'handleUncaught']);
            register_shutdown_function([$this, 'handleShutdown']);
        } else {
            register_shutdown_function([$this, 'throwFatalErrorException']);
        }
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 public function register()
 {
     $dic = $this->app->getContainer();
     $debug = $this->app->getConfig()->get('app.debug');
     $this->manager = new ErrorHandlerManager(new HandlerResolver($dic));
     $this->manager->setDefaultHandler(new DefaultErrorHandler($debug));
     $this->app->setErrorHandler($this->manager);
     if ($this->register) {
         $this->manager->register();
     }
     $dic->instance('Autarky\\Errors\\ErrorHandlerManager', $this->manager);
     $dic->alias('Autarky\\Errors\\ErrorHandlerManager', 'Autarky\\Errors\\ErrorHandlerManagerInterface');
     $this->app->config([$this, 'configureErrorHandler']);
 }