| @@ 53-59 (lines=7) @@ | ||
| 50 | $source = $source->source; |
|
| 51 | ||
| 52 | // Trim empty lines from the start and end of the source |
|
| 53 | foreach ($source as $linenum => $line) { |
|
| 54 | if (trim($line) || $linenum === $line_wanted) { |
|
| 55 | break; |
|
| 56 | } else { |
|
| 57 | unset($source[$linenum]); |
|
| 58 | } |
|
| 59 | } |
|
| 60 | ||
| 61 | foreach (array_reverse($source, true) as $linenum => $line) { |
|
| 62 | if (trim($line) || $linenum === $line_wanted) { |
|
| @@ 61-67 (lines=7) @@ | ||
| 58 | } |
|
| 59 | } |
|
| 60 | ||
| 61 | foreach (array_reverse($source, true) as $linenum => $line) { |
|
| 62 | if (trim($line) || $linenum === $line_wanted) { |
|
| 63 | break; |
|
| 64 | } else { |
|
| 65 | unset($source[$linenum]); |
|
| 66 | } |
|
| 67 | } |
|
| 68 | ||
| 69 | foreach ($source as $lineno => $line) { |
|
| 70 | if ($lineno == $line_wanted) { |
|