PhpParser\Error::getEndLine PHP Method

getEndLine() public method

Gets the line the error ends in.
public getEndLine ( ) : integer
return integer Error end line
    public function getEndLine()
    {
        return isset($this->attributes['endLine']) ? $this->attributes['endLine'] : -1;
    }

Usage Example

 private function formatErrorMessage(Error $e, $code)
 {
     if ($e->hasColumnInfo()) {
         return $e->getRawMessage() . ' from ' . $e->getStartLine() . ':' . $e->getStartColumn($code) . ' to ' . $e->getEndLine() . ':' . $e->getEndColumn($code);
     } else {
         return $e->getMessage();
     }
 }