public static function fromBacktrace(Configuration $config, array $backtrace, $topFile, $topLine)
    {
        $stacktrace = new static($config);

        // PHP backtrace's are misaligned, we need to shift the file/line down a frame
        foreach ($backtrace as $frame) {
            if (!static::frameInsideBugsnag($frame)) {
                $stacktrace->addFrame(
                    $topFile,
                    $topLine,
                    isset($frame['function']) ? $frame['function'] : null,
                    isset($frame['class']) ? $frame['class'] : null
                );
            }

            if (isset($frame['file']) && isset($frame['line'])) {
                $topFile = $frame['file'];
                $topLine = $frame['line'];
            } else {
                $topFile = '[internal]';
                $topLine = 0;
            }
        }

        // Add a final stackframe for the "main" method
        $stacktrace->addFrame($topFile, $topLine, '[main]');

        return $stacktrace;
    }
public static function fromBacktrace(Configuration $config, array $backtrace, $topFile, $topLine)
    {
        $stacktrace = new static($config);

        // PHP backtrace's are misaligned, we need to shift the file/line down a frame
        foreach ($backtrace as $frame) {
            if (!static::frameInsideBugsnag($frame)) {
                $stacktrace->addFrame(
                    $topFile,
                    $topLine,
                    isset($frame['function']) ? $frame['function'] : null,
                    isset($frame['class']) ? $frame['class'] : null
                );
            }

            if (isset($frame['file']) && isset($frame['line'])) {
                $topFile = $frame['file'];
                $topLine = $frame['line'];
            } else {
                $topFile = '[internal]';
                $topLine = 0;
            }
        }

        // Add a final stackframe for the "main" method
        $stacktrace->addFrame($topFile, $topLine, '[main]');

        return $stacktrace;
    }
public static function fromBacktrace ( Configuration $ config , array $ backtrace , $ topFile , $ topLine ) { $ stacktrace = new static ( $ config ) ; // PHP backtrace's are misaligned, we need to shift the file/line down a frame foreach ( $ backtrace as $ frame ) { if ( ! static :: frameInsideBugsnag ( $ frame ) ) { $ stacktrace -> addFrame ( $ topFile , $ topLine , isset ( $ frame [ 'function' ] ) ? $ frame [ 'function' ] : null , isset ( $ frame [ 'class' ] ) ? $ frame [ 'class' ] : null ) ; } if ( isset ( $ frame [ 'file' ] ) && isset ( $ frame [ 'line' ] ) ) { $ topFile = $ frame [ 'file' ] ; $ topLine = $ frame [ 'line' ] ; } else { $ topFile = '[internal]' ; $ topLine = 0 ; } } // Add a final stackframe for the "main" method $ stacktrace -> addFrame ( $ topFile , $ topLine , '[main]' ) ; return $ stacktrace ; }
Create a new stacktrace instance from a backtrace.

@param \Bugsnag\Configuration $config    the configuration instance
@param array                  $backtrace the associated backtrace
@param int                    $topFile   the top file to use
@param int                    $topLine   the top line to use

@return static
Create a new stacktrace instance from a backtrace .