original_string: public function enableErrorHandler(array $options = []): void
      {
          if ($this->errorHandlerEnabled) {
              throw new \Exception('The error handler is already enabled!');
          }
          set_exception_handler(function($exception) use ($options) {
              \BearFramework\Internal\ErrorHandler::handleException($this, $exception, $options);
          });
          register_shutdown_function(function() use ($options) {
              $errorData = error_get_last();
              if (is_array($errorData)) {
                  \BearFramework\Internal\ErrorHandler::handleFatalError($this, $errorData, $options);
              }
          });
          set_error_handler(function($errorNumber, $errorMessage, $errorFile, $errorLine) {
              throw new \ErrorException($errorMessage, 0, $errorNumber, $errorFile, $errorLine);
          });
          $this->errorHandlerEnabled = true;
      }
code: public function enableErrorHandler(array $options = []): void
      {
          if ($this->errorHandlerEnabled) {
              throw new \Exception('The error handler is already enabled!');
          }
          set_exception_handler(function($exception) use ($options) {
              \BearFramework\Internal\ErrorHandler::handleException($this, $exception, $options);
          });
          register_shutdown_function(function() use ($options) {
              $errorData = error_get_last();
              if (is_array($errorData)) {
                  \BearFramework\Internal\ErrorHandler::handleFatalError($this, $errorData, $options);
              }
          });
          set_error_handler(function($errorNumber, $errorMessage, $errorFile, $errorLine) {
              throw new \ErrorException($errorMessage, 0, $errorNumber, $errorFile, $errorLine);
          });
          $this->errorHandlerEnabled = true;
      }
code_tokens: public function enableErrorHandler ( array $ options = [ ] ) : void { if ( $ this -> errorHandlerEnabled ) { throw new \ Exception ( 'The error handler is already enabled!' ) ; } set_exception_handler ( function ( $ exception ) use ( $ options ) { \ BearFramework \ Internal \ ErrorHandler :: handleException ( $ this , $ exception , $ options ) ; } ) ; register_shutdown_function ( function ( ) use ( $ options ) { $ errorData = error_get_last ( ) ; if ( is_array ( $ errorData ) ) { \ BearFramework \ Internal \ ErrorHandler :: handleFatalError ( $ this , $ errorData , $ options ) ; } } ) ; set_error_handler ( function ( $ errorNumber , $ errorMessage , $ errorFile , $ errorLine ) { throw new \ ErrorException ( $ errorMessage , 0 , $ errorNumber , $ errorFile , $ errorLine ) ; } ) ; $ this -> errorHandlerEnabled = true ; }
docstring: Enables an error handler.
  
  @param array $options Error handler options. Available values: logErrors (bool), displayErrors (bool).
  @return void No value is returned.
  @throws \Exception
docstring_tokens: Enables an error handler .