final class Trivia
Restricted visibility: declared "@visibility SqlFormatter". Code outside that scope must not name this declaration.

Removes ordinary comments while retaining directives and executable comment bodies.

Properties§

public bool $executable = false

Whether the next token belongs to an executable comment body.

Methods§

public function __construct(private Closure(string, int, int, int, bool): bool $nesting)

Parameters

$nestingClosure(string, int, int, int, bool): boolBlock comment nesting rule
public function clean(string $text): string
public function executablePart(string $text, int &$offset): string

Copies trivia inside executable SQL without confusing inner and outer comments.

Parameters

$textstring
$offsetint

Returns

string
Test cases 1
Called from 1
Calls 3
public function blockEnd(string $text, int $start): int

Finds the end of a comment using the supplied nesting behavior.

Parameters

$textstring
$startint

Returns

int
Test cases 1
Called from 2
Calls 2

Private surface 1§

Implementation details, listed for orientation only.

private Closure(string, int, int, int, bool): bool $nesting

Test cases 20§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 5
Other tests reaching this symbol 15

Relations§

Instantiated in 1
Method calls 2