src/Analysis/Debugger.php
public static function focus($pattern, $backtrace, $depth = null, $maxLookup = 10)
    {
        if (!$pattern) {
            return $backtrace;
        }

        $i = 0;
        $start = 0;
        $found = false;

        while ($i < $maxLookup && isset($backtrace[$i])) {
            if (isset($backtrace[$i]['file'])) {
                $start = $start ?: $i;
                if (preg_match('~^' . $pattern . '$~', $backtrace[$i]['file'])) {
                    $found = true;
                    break;
                }
            }
            $i++;
        }
        return array_slice(array_slice($backtrace, $found ? $i : $start), 0, $depth);
    }
public static function focus($pattern, $backtrace, $depth = null, $maxLookup = 10)
    {
        if (!$pattern) {
            return $backtrace;
        }

        $i = 0;
        $start = 0;
        $found = false;

        while ($i < $maxLookup && isset($backtrace[$i])) {
            if (isset($backtrace[$i]['file'])) {
                $start = $start ?: $i;
                if (preg_match('~^' . $pattern . '$~', $backtrace[$i]['file'])) {
                    $found = true;
                    break;
                }
            }
            $i++;
        }
        return array_slice(array_slice($backtrace, $found ? $i : $start), 0, $depth);
    }
public static function focus ( $ pattern , $ backtrace , $ depth = null , $ maxLookup = 10 ) { if ( ! $ pattern ) { return $ backtrace ; } $ i = 0 ; $ start = 0 ; $ found = false ; while ( $ i < $ maxLookup && isset ( $ backtrace [ $ i ] ) ) { if ( isset ( $ backtrace [ $ i ] [ 'file' ] ) ) { $ start = $ start ? : $ i ; if ( preg_match ( '~^' . $ pattern . '$~' , $ backtrace [ $ i ] [ 'file' ] ) ) { $ found = true ; break ; } } $ i ++ ; } return array_slice ( array_slice ( $ backtrace , $ found ? $ i : $ start ) , 0 , $ depth ) ; }
Unstack all traces up to a trace which match a filename regexp.

@param  array $pattern    The regexp to match on.
@param  array $backtrace  The backtrace.
@param  array $depth      Number of traces to keep.
@param  int   $maxLookup  The maximum lookup window.

@return array             A cleaned backtrace.
Unstack all traces up to a trace which match a filename regexp .