When Method reflection is returning no lines its creating error "undefined variable $firstLine"

...the code leads to error "undefined variable  $firstLine".