function error(ErrorBase $error)
 {
     //if(!$error->isFatal()){
     if ($error instanceof PHPError) {
         switch ($error->getErrno()) {
             case E_COMPILE_WARNING:
             case E_CORE_WARNING:
             case E_USER_WARNING:
             case E_WARNING:
                 \Radical\CLI\Output\Error::Warning($error->getMessage());
                 break;
             case E_NOTICE:
             case E_STRICT:
             case E_USER_NOTICE:
             case E_USER_DEPRECATED:
             case E_DEPRECATED:
                 \Radical\CLI\Output\Error::Notice($error->getMessage());
                 break;
         }
     }
     //}
     return parent::error($error);
 }
Example #2
0
            $errorHandler = Handler::getInstance();
            if ($errorHandler->isNull()) {
                $str = sprintf(static::FORMAT, $code, $str);
                parent::Output($str);
            } else {
                new Error\OutputError($str, $code);
            }
        }
    }
    static function notice($str)
    {
        static::Output('NOTICE', $str, E_NOTICE);
    }
    static function warning($str)
    {
        static::Output('WARN', $str, E_NOTICE);
    }
    static function error($str)
    {
        static::Output('ERROR', $str, E_NOTICE);
    }
    static function fatal($str, $exit = true)
    {
        static::Output('FATAL', $str, E_NOTICE);
        if ($exit) {
            exit;
        }
    }
}
Error::Init();