public static function handleError($errNum, $errStr, $errFile, $errLine)
    {
        // If a command is called with "@", then we should return
        if (error_reporting() == 0) {
            return true;
        }

        if (!self::$errorFlag) {
            self::$errorFlag = true;
        } else {
            return true; // Already are handling an error. Indicates an additional error condition during error handling
        }

        switch ($errNum) {
            case E_ERROR:
                $code = "E_ERROR";
                break;
            case E_WARNING:
                $code = "E_WARNING";
                break;
            case E_PARSE:
                $code = "E_PARSE";
                break;
            case E_NOTICE:
                $code = "E_NOTICE";
                break;
            case E_STRICT:
                $code = "E_STRICT";
                break;
            case E_CORE_ERROR:
                $code = "E_CORE_ERROR";
                break;
            case E_CORE_WARNING:
                $code = "E_CORE_WARNING";
                break;
            case E_COMPILE_ERROR:
                $code = "E_COMPILE_ERROR";
                break;
            case E_COMPILE_WARNING:
                $code = "E_COMPILE_WARNING";
                break;
            case E_USER_ERROR:
                $code = "E_USER_ERROR";
                break;
            case E_USER_WARNING:
                $code = "E_USER_WARNING";
                break;
            case E_USER_NOTICE:
                $code = "E_USER_NOTICE";
                break;
            case E_DEPRECATED:
                $code = 'E_DEPRECATED';
                break;
            case E_USER_DEPRECATED:
                $code = 'E_USER_DEPRECATED';
                break;
            case E_RECOVERABLE_ERROR:
                $code = 'E_RECOVERABLE_ERROR';
                break;
            default:
                $code = "Unknown";
                break;
        }

        static::displayError(
            "Error",
            $errNum,
            $code,
            $errStr,
            $errFile,
            $errLine,
            self::getBacktrace(),
            null
        );
        return false;
    }