src/Whoops/Exception/Frame.php
public function getFileLines($start = 0, $length = null)
    {
        if (null !== ($contents = $this->getFileContents())) {
            $lines = explode("\n", $contents);

            // Get a subset of lines from $start to $end
            if ($length !== null) {
                $start  = (int) $start;
                $length = (int) $length;
                if ($start < 0) {
                    $start = 0;
                }

                if ($length <= 0) {
                    throw new InvalidArgumentException(
                        "\$length($length) cannot be lower or equal to 0"
                    );
                }

                $lines = array_slice($lines, $start, $length, true);
            }

            return $lines;
        }
    }
public function getFileLines($start = 0, $length = null)
    {
        if (null !== ($contents = $this->getFileContents())) {
            $lines = explode("\n", $contents);

            // Get a subset of lines from $start to $end
            if ($length !== null) {
                $start  = (int) $start;
                $length = (int) $length;
                if ($start < 0) {
                    $start = 0;
                }

                if ($length <= 0) {
                    throw new InvalidArgumentException(
                        "\$length($length) cannot be lower or equal to 0"
                    );
                }

                $lines = array_slice($lines, $start, $length, true);
            }

            return $lines;
        }
    }
public function getFileLines ( $ start = 0 , $ length = null ) { if ( null !== ( $ contents = $ this -> getFileContents ( ) ) ) { $ lines = explode ( "\n" , $ contents ) ; // Get a subset of lines from $start to $end if ( $ length !== null ) { $ start = ( int ) $ start ; $ length = ( int ) $ length ; if ( $ start < 0 ) { $ start = 0 ; } if ( $ length <= 0 ) { throw new InvalidArgumentException ( "\$length($length) cannot be lower or equal to 0" ) ; } $ lines = array_slice ( $ lines , $ start , $ length , true ) ; } return $ lines ; } }
Returns the contents of the file for this frame as an
array of lines, and optionally as a clamped range of lines.

NOTE: lines are 0-indexed

@example
Get all lines for this file
$frame->getFileLines(); // => array( 0 => '<?php', 1 => '...', ...)
@example
Get one line for this file, starting at line 10 (zero-indexed, remember!)
$frame->getFileLines(9, 1); // array( 10 => '...', 11 => '...')

@throws InvalidArgumentException if $length is less than or equal to 0
@param  int                      $start
@param  int                      $length
@return string[]|null
Returns the contents of the file for this frame as an array of lines and optionally as a clamped range of lines .