Copied!
CloneableInstantiable
Methods
public PhpParser\Comment::__construct(string $text, int $startLine = -1, int $startFilePos = -1, int $startTokenPos = -1, int $endLine = -1, int $endFilePos = -1, int $endTokenPos = -1)
 

Constructs a comment node.

  • param string $text Comment text (including comment delimiters like /*)
  • param int $startLine Line number the comment started on
  • param int $startFilePos File offset the comment started on
  • param int $startTokenPos Token offset the comment started on
public PhpParser\Comment::__toString() : string
 

Gets the comment text.

  • return string The comment text (including comment delimiters like /*)
public PhpParser\Comment::getEndFilePos() : int
 

Gets the file offset the comment ends on.

  • return int File offset (or -1 if not available)
public PhpParser\Comment::getEndLine() : int
 

Gets the line number the comment ends on.

  • return int Line number (or -1 if not available)
public PhpParser\Comment::getEndTokenPos() : int
 

Gets the token offset the comment ends on.

  • return int Token offset (or -1 if not available)
public PhpParser\Comment::getFilePos() : int
 

Gets the file offset the comment started on.

  • deprecated Use getStartFilePos() instead
  • return int File offset
public PhpParser\Comment::getLine() : int
 

Gets the line number the comment started on.

  • deprecated Use getStartLine() instead
  • return int Line number
public PhpParser\Comment::getReformattedText()
 

Gets the reformatted comment text.

"Reformatted" here means that we try to clean up the whitespace at the
starts of the lines. This is necessary because we receive the comments
without trailing whitespace on the first line, but with trailing whitespace
on all subsequent lines.

  • return mixed|string
public PhpParser\Comment::getStartFilePos() : int
 

Gets the file offset the comment started on.

  • return int File offset (or -1 if not available)
public PhpParser\Comment::getStartLine() : int
 

Gets the line number the comment started on.

  • return int Line number (or -1 if not available)
public PhpParser\Comment::getStartTokenPos() : int
 

Gets the token offset the comment started on.

  • return int Token offset (or -1 if not available)
public PhpParser\Comment::getText() : string
 

Gets the comment text.

  • return string The comment text (including comment delimiters like /*)
public PhpParser\Comment::getTokenPos() : int
 

Gets the token offset the comment started on.

  • deprecated Use getStartTokenPos() instead
  • return int Token offset
public PhpParser\Comment::jsonSerialize() : array
 
  • return array
  • psalm-return array{nodeType:string, text:mixed, line:mixed, filePos:mixed}
Properties
protected PhpParser\Comment::$endFilePos = NULL
protected PhpParser\Comment::$endLine = NULL
protected PhpParser\Comment::$endTokenPos = NULL
protected PhpParser\Comment::$startFilePos = NULL
protected PhpParser\Comment::$startLine = NULL
protected PhpParser\Comment::$startTokenPos = NULL
protected PhpParser\Comment::$text = NULL
© 2023 Bruce Wells
Search Namespaces \ Classes
Configuration