Beispiel #1
0
 /**
  * render.
  *
  * @method render
  *
  * @param \Exception $exception
  * @param array $error
  *
  * @return \Exception
  */
 protected function fixStack($exception, $error)
 {
     if (in_array($error['type'], [E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE, E_RECOVERABLE_ERROR, E_USER_ERROR], true) === true) {
         return Helpers::fixStack(new ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line']));
     }
     return $exception;
 }
Beispiel #2
0
 /**
  * Shutdown handler to catch fatal errors and execute of the planned activities.
  * @return void
  * @internal
  */
 public static function shutdownHandler()
 {
     if (self::$done) {
         return;
     }
     $error = error_get_last();
     if (in_array($error['type'], [E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE, E_RECOVERABLE_ERROR, E_USER_ERROR], TRUE)) {
         self::exceptionHandler(Helpers::fixStack(new ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line'])), FALSE);
     } elseif (!connection_aborted() && !self::$productionMode && self::isHtmlMode()) {
         self::getBar()->render();
     }
 }
Beispiel #3
0
 /**
  * Shutdown handler to catch fatal errors and execute of the planned activities.
  * @return void
  * @internal
  */
 public static function shutdownHandler()
 {
     if (!self::$reserved) {
         return;
     }
     $error = error_get_last();
     if (in_array($error['type'], [E_ERROR, E_CORE_ERROR, E_COMPILE_ERROR, E_PARSE, E_RECOVERABLE_ERROR, E_USER_ERROR], TRUE)) {
         self::exceptionHandler(Helpers::fixStack(new ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line'])), FALSE);
     } elseif (self::$showBar && !self::$productionMode) {
         self::$reserved = NULL;
         self::removeOutputBuffers(FALSE);
         self::getBar()->render();
     }
 }