src/SmartFactory/ErrorHandler.php
public function handleError($errno, $errstr, $errfile, $errline)
    {
        $this->setLastError($errstr);
        
        $errortype = [
            E_ERROR => "Error",
            E_WARNING => "Warning",
            E_PARSE => "Parsing Error",
            E_NOTICE => "Notice",
            E_CORE_ERROR => "Core Error",
            E_CORE_WARNING => "Core Warning",
            E_COMPILE_ERROR => "Compile Error",
            E_COMPILE_WARNING => "Compile Warning",
            E_USER_ERROR => "User Error",
            E_USER_WARNING => "User Warning",
            E_USER_NOTICE => "User Notice",
            E_STRICT => "Runtime Notice",
            E_DEPRECATED => "Deprecated Notice"
        ];
        
        if (empty($errortype[$errno])) {
            $etype = $errno;
        } else {
            $etype = $errortype[$errno];
        }
        
        $this->trace_message($this->format_backtrace(debug_backtrace()));
        
        event()->fireEvent("php_error", ["etype" => $etype, "errstr" => $errstr, "errfile" => $errfile, "errline" => $errline]);
    }
public function handleError($errno, $errstr, $errfile, $errline)
    {
        $this->setLastError($errstr);
        
        $errortype = [
            E_ERROR => "Error",
            E_WARNING => "Warning",
            E_PARSE => "Parsing Error",
            E_NOTICE => "Notice",
            E_CORE_ERROR => "Core Error",
            E_CORE_WARNING => "Core Warning",
            E_COMPILE_ERROR => "Compile Error",
            E_COMPILE_WARNING => "Compile Warning",
            E_USER_ERROR => "User Error",
            E_USER_WARNING => "User Warning",
            E_USER_NOTICE => "User Notice",
            E_STRICT => "Runtime Notice",
            E_DEPRECATED => "Deprecated Notice"
        ];
        
        if (empty($errortype[$errno])) {
            $etype = $errno;
        } else {
            $etype = $errortype[$errno];
        }
        
        $this->trace_message($this->format_backtrace(debug_backtrace()));
        
        event()->fireEvent("php_error", ["etype" => $etype, "errstr" => $errstr, "errfile" => $errfile, "errline" => $errline]);
    }
public function handleError ( $ errno , $ errstr , $ errfile , $ errline ) { $ this -> setLastError ( $ errstr ) ; $ errortype = [ E_ERROR => "Error" , E_WARNING => "Warning" , E_PARSE => "Parsing Error" , E_NOTICE => "Notice" , E_CORE_ERROR => "Core Error" , E_CORE_WARNING => "Core Warning" , E_COMPILE_ERROR => "Compile Error" , E_COMPILE_WARNING => "Compile Warning" , E_USER_ERROR => "User Error" , E_USER_WARNING => "User Warning" , E_USER_NOTICE => "User Notice" , E_STRICT => "Runtime Notice" , E_DEPRECATED => "Deprecated Notice" ] ; if ( empty ( $ errortype [ $ errno ] ) ) { $ etype = $ errno ; } else { $ etype = $ errortype [ $ errno ] ; } $ this -> trace_message ( $ this -> format_backtrace ( debug_backtrace ( ) ) ) ; event ( ) -> fireEvent ( "php_error" , [ "etype" => $ etype , "errstr" => $ errstr , "errfile" => $ errfile , "errline" => $ errline ] ) ; }
This is the function for handling of the PHP errors. It is set a the
error handler.

@param int $errno
Error code.

@param string $errstr
Error text.

@param string $errfile
Source file where the error occured.

@param int $errline
Line number where the error occured.

@return void

@author Oleg Schildt
This is the function for handling of the PHP errors . It is set a the error handler .