PhpParser\Error::getStartLine PHP Method

getStartLine() public method

Gets the line the error starts in.
public getStartLine ( ) : integer
return integer Error start line
    public function getStartLine()
    {
        return isset($this->attributes['startLine']) ? $this->attributes['startLine'] : -1;
    }

Usage Example

Ejemplo n.º 1
0
 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();
     }
 }
All Usage Examples Of PhpParser\Error::getStartLine