/** * 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; }
/** * 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(); } }
/** * 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(); } }