original_string: public function handle($running_env = self::DEFAULT_ENVIRONMENT, callable $callback = null)
      {
          $is_handled = false;
          if (!$this->is_handling && !$this->last_error) {
              $this->swapCallable($running_env, $callback, $this->running_env, false);
              $this->setRunningEnvironment($running_env);
              if ($callback) {
                  $this->setCallback($callback);
              }
              
              $this->prev_exception_handler = set_exception_handler($this->getUncaughtExceptionHandler());
              $this->prev_error_handler     = set_error_handler($this->getCoreErrorHandler());
              register_shutdown_function(function() {
                      if ($error = error_get_last()) {
                          $this->handleCoreError(
                              $error["type"],
                              $error["message"],
                              $error["file"],
                              $error["line"]
                          );
                      }
                  });
              
              $this->is_handling = true;
              $is_handled = true;
          }
  
          return $is_handled;
      }
code: public function handle($running_env = self::DEFAULT_ENVIRONMENT, callable $callback = null)
      {
          $is_handled = false;
          if (!$this->is_handling && !$this->last_error) {
              $this->swapCallable($running_env, $callback, $this->running_env, false);
              $this->setRunningEnvironment($running_env);
              if ($callback) {
                  $this->setCallback($callback);
              }
              
              $this->prev_exception_handler = set_exception_handler($this->getUncaughtExceptionHandler());
              $this->prev_error_handler     = set_error_handler($this->getCoreErrorHandler());
              register_shutdown_function(function() {
                      if ($error = error_get_last()) {
                          $this->handleCoreError(
                              $error["type"],
                              $error["message"],
                              $error["file"],
                              $error["line"]
                          );
                      }
                  });
              
              $this->is_handling = true;
              $is_handled = true;
          }
  
          return $is_handled;
      }
code_tokens: public function handle ( $ running_env = self :: DEFAULT_ENVIRONMENT , callable $ callback = null ) { $ is_handled = false ; if ( ! $ this -> is_handling && ! $ this -> last_error ) { $ this -> swapCallable ( $ running_env , $ callback , $ this -> running_env , false ) ; $ this -> setRunningEnvironment ( $ running_env ) ; if ( $ callback ) { $ this -> setCallback ( $ callback ) ; } $ this -> prev_exception_handler = set_exception_handler ( $ this -> getUncaughtExceptionHandler ( ) ) ; $ this -> prev_error_handler = set_error_handler ( $ this -> getCoreErrorHandler ( ) ) ; register_shutdown_function ( function ( ) { if ( $ error = error_get_last ( ) ) { $ this -> handleCoreError ( $ error [ "type" ] , $ error [ "message" ] , $ error [ "file" ] , $ error [ "line" ] ) ; } } ) ; $ this -> is_handling = true ; $ is_handled = true ; } return $ is_handled ; }
docstring: Starts handling errors
  
  Returns true when errors are now being handled, or false when errors were already
  being handled. Possibly because ::handle() had already been called, or an error has
  already been handled.
  
  Examples:
  ```
  $handler = new ErrorHandler();
  $handler->handle();
  
  $handler = new ErrorHandler();
  $handler->setCallback(function() { echo "Look out!"; });
  $handler->handle();
  
  $handler = new ErrorHandler();
  $handler->setRunningEnvironment("live");
  $handler->setCallback("live", function() { echo "Look out!"; });
  $handler->handle();
  
  $handler = new ErrorHandler();
  $handler->handle("live", function() { echo "Look out!"; });
  ```
  
  @param  string   $running_env The running environment
  @param  callable $callback    The error callback
  @return bool
docstring_tokens: Starts handling errors