src/Analysis/Debugger.php
protected static function _line($trace)
    {
        $path = $trace['file'];
        $callLine = $trace['line'];
        if (!file_exists($path)) {
            return;
        }
        $file = file_get_contents($path);
        if (($i = static::_findPos($file, $callLine)) === null) {
            return;
        }
        $line = $callLine;

        $brackets = 0;
        while ($i >= 0) {
            if ($file[$i] === ')') {
                $brackets--;
            } elseif ($file[$i] === '(') {
                $brackets++;
            } elseif ($file[$i] === "\n") {
                $line--;
            }
            if ($brackets > 0) {
                return $line;
            }
            $i--;
        }
    }
protected static function _line($trace)
    {
        $path = $trace['file'];
        $callLine = $trace['line'];
        if (!file_exists($path)) {
            return;
        }
        $file = file_get_contents($path);
        if (($i = static::_findPos($file, $callLine)) === null) {
            return;
        }
        $line = $callLine;

        $brackets = 0;
        while ($i >= 0) {
            if ($file[$i] === ')') {
                $brackets--;
            } elseif ($file[$i] === '(') {
                $brackets++;
            } elseif ($file[$i] === "\n") {
                $line--;
            }
            if ($brackets > 0) {
                return $line;
            }
            $i--;
        }
    }
protected static function _line ( $ trace ) { $ path = $ trace [ 'file' ] ; $ callLine = $ trace [ 'line' ] ; if ( ! file_exists ( $ path ) ) { return ; } $ file = file_get_contents ( $ path ) ; if ( ( $ i = static :: _findPos ( $ file , $ callLine ) ) === null ) { return ; } $ line = $ callLine ; $ brackets = 0 ; while ( $ i >= 0 ) { if ( $ file [ $ i ] === ')' ) { $ brackets -- ; } elseif ( $ file [ $ i ] === '(' ) { $ brackets ++ ; } elseif ( $ file [ $ i ] === "\n" ) { $ line -- ; } if ( $ brackets > 0 ) { return $ line ; } $ i -- ; } }
Locates a line number from a trace.

@param  array $trace A trace data.
@return mixed        Returns the line number where the method called is defined.
Locates a line number from a trace .