CloneableInstantiable
ExtendsPhpParser\Comment
ImplementsJsonSerializable
Methods
public PhpParser\Comment::__construct(string $text, int $startLine = -1, int $startFilePos = -1, int $startTokenPos = -1)
 
Constructs a comment node.

    public PhpParser\Comment::__toString() : string
     
    Gets the comment text.

    • return string The comment text (including comment delimiters like /*)
    public PhpParser\Comment::getFilePos() : int
     
    Gets the file offset the comment started on.

    • return int File offset
    public PhpParser\Comment::getLine() : int
     
    Gets the line number the comment started on.

    • 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::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.

    • 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::$filePos
    protected PhpParser\Comment::$line
    protected PhpParser\Comment::$text
    protected PhpParser\Comment::$tokenPos
    Methods
    private PhpParser\Comment::getShortestWhitespacePrefixLen(string $str) : int
     
    Get length of shortest whitespace prefix (at the start of a line).

    If there is a line with no prefix whitespace, 0 is a valid return value.

    • return int Length in characters. Tabs count as single characters.
    © 2020 Bruce Wells
    Search Namespaces \ Classes
    ConfigurationNumbers (0-9.) only