protected static function getBounds($line, $num, $max)
    {
        $start = max($line - floor($num / 2), 1);

        $end = $start + ($num - 1);

        if ($end > $max) {
            $end = $max;
            $start = max($end - ($num - 1), 1);
        }

        return [$start, $end];
    }
protected static function getBounds($line, $num, $max)
    {
        $start = max($line - floor($num / 2), 1);

        $end = $start + ($num - 1);

        if ($end > $max) {
            $end = $max;
            $start = max($end - ($num - 1), 1);
        }

        return [$start, $end];
    }
protected static function getBounds ( $ line , $ num , $ max ) { $ start = max ( $ line - floor ( $ num / 2 ) , 1 ) ; $ end = $ start + ( $ num - 1 ) ; if ( $ end > $ max ) { $ end = $ max ; $ start = max ( $ end - ( $ num - 1 ) , 1 ) ; } return [ $ start , $ end ] ; }
Get the start and end positions for the given line.

@param int    $line the line to centre about
@param string $num  the number of lines to fetch
@param int    $max  the maximum line number

@return int[]
Get the start and end positions for the given line .