Cml\Debug::catcher PHP Method

catcher() public static method

错误handler
public static catcher ( integer $errorType, string $errorTip, string $errorFile, integer $errorLine ) : void
$errorType integer 错误类型 分运行时警告、运行时提醒、自定义错误、自定义提醒、未知等
$errorTip string 错误提示
$errorFile string 发生错误的文件
$errorLine integer 错误所在行数
return void
    public static function catcher($errorType, $errorTip, $errorFile, $errorLine)
    {
        if (!isset(self::$tipInfoType[$errorType])) {
            $errorType = 'Unknow';
        }
        if ($errorType == E_NOTICE || $errorType == E_USER_NOTICE) {
            $color = '#000088';
        } else {
            $color = 'red';
        }
        $mess = "<span style='color:{$color}'>";
        $mess .= '<b>' . self::$tipInfoType[$errorType] . "</b>[在文件 {$errorFile} 中,第 {$errorLine} 行]:";
        $mess .= $errorTip;
        $mess .= '</span>';
        self::addTipInfo($mess);
    }