Jyxo\ErrorHandler::handleFatalError PHP Метод

handleFatalError() публичный статический Метод

Handles critical errors and logs them.
public static handleFatalError ( )
    public static function handleFatalError()
    {
        // List of critical errors
        static $fatalErrors = [E_ERROR => true, E_CORE_ERROR => true, E_COMPILE_ERROR => true, E_PARSE => true];
        // If the last error was critical
        $error = error_get_last();
        if (isset($fatalErrors[$error['type']])) {
            self::log(['type' => self::FATAL, 'text' => $error['message'], 'file' => $error['file'], 'line' => $error['line']]);
            if (self::$errorMail) {
                $ex = new \ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line']);
                self::$errorMail->send($ex);
            }
        }
    }