classSourceComments
final class SourceComments
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.
The comments of one parse tree, by the token each was written before.
The comments before a node are those before its first token, which this value finds without collecting the node's other tokens.
Properties§
public list<string> $leadingpublic list<string> $trailingMethods§
public function __construct(
public list<string> $leading,
private array<int, list<string>> $before,
public list<string> $trailing,
)Parameters
$leading | list<string> | Comments before the first token |
$before | array<int, list<string>> | Comments by the object id of the token they precede |
$trailing | list<string> | Comments after the last token that spells SQL |
public function before(Token $token): list<string>Finds the first token below a node, or null when the node spells nothing.
Parameters
$node | Node |
Returns
Called from 2
Calls 1
- method-call SourceComments::first() line 48
Private surface 1§
Implementation details, listed for orientation only.
private array<int, list<string>> $beforeTest cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 4
TriviaReaderTestcallsValueReaderTestcallsStatementTestcallsWriterTestcalls