PhpParser\Error::hasColumnInfo PHP Method

hasColumnInfo() public method

For column information enable the startFilePos and endFilePos in the lexer options.
public hasColumnInfo ( ) : boolean
return boolean
    public function hasColumnInfo()
    {
        return isset($this->attributes['startFilePos']) && isset($this->attributes['endFilePos']);
    }

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();
     }
 }
All Usage Examples Of PhpParser\Error::hasColumnInfo