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> $leading
public list<string> $trailing

Methods§

public function __construct(
    public list<string> $leading,
    private array<int, list<string>> $before,
    public list<string> $trailing,
)

Parameters

$leadinglist<string>Comments before the first token
$beforearray<int, list<string>>Comments by the object id of the token they precede
$trailinglist<string>Comments after the last token that spells SQL
public function before(Token $token): list<string>

Answers the comments written before a token, in order.

Parameters

$tokenToken

Returns

list<string>
Test cases 1
Called from 1
Calls 1
  • function-call spl_object_id line 39

Private surface 1§

Implementation details, listed for orientation only.

private array<int, list<string>> $before

Test 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

Relations§

Instantiated in 1
Method calls 2
Type declarations 2