HM\BackUpWordPress\Backup_Engine::error_handler PHP Method

error_handler() public method

PHP errors are always treat as warnings rather than errors.
public error_handler ( integer $type ) : boolean
$type integer The level of error raised.
return boolean Return false to pass the error back to PHP so it can be handled natively.
    public function error_handler($type)
    {
        // Skip strict & deprecated warnings.
        if (defined('E_DEPRECATED') && E_DEPRECATED === $type || defined('E_STRICT') && E_STRICT === $type || 0 === error_reporting()) {
            return false;
        }
        /**
         * Get the details of the error.
         *
         * These are:
         *
         * @param int    $errorno   The error level expressed as an integer.
         * @param string $errstr    The error message.
         * @param string $errfile   The file that the error raised in.
         * @param string $errorline The line number the error was raised on.
         */
        $args = func_get_args();
        // Strip the error level
        array_shift($args);
        // Fire a warning for the PHP error passing the message, file and line number.
        $this->warning('php', implode(', ', array_splice($args, 0, 3)));
        return false;
    }