FUnit::parse_backtrace PHP Method

parse_backtrace() public static method

this generates an array of formatted strings to represent the backtrace
See also: FUnit::error_handler()
See also: FUnit::exception_handler()
public static parse_backtrace ( array $bt_raw ) : array
$bt_raw array the raw backtrace array
return array an array of strings
    public static function parse_backtrace($bt_raw)
    {
        $backtrace = array();
        foreach ($bt_raw as $bt) {
            if (isset($bt['function']) && __FUNCTION__ == $bt['function'] && isset($bt['class']) && __CLASS__ == $bt['class']) {
                continue;
                // don't bother backtracing
            }
            if (isset($bt['file'], $bt['line'])) {
                $trace = $bt['file'] . '#' . $bt['line'];
            } else {
                $trace = '';
            }
            if (isset($bt['class']) && isset($bt['function'])) {
                $trace .= " {$bt['class']}::{$bt['function']}(...)";
            } elseif (isset($bt['function'])) {
                $trace .= " {$bt['function']}(...)";
            }
            $backtrace[] = $trace;
        }
        return $backtrace;
    }