classWriter
final class Writer
Restricted visibility: declared "@visibility SqlFormatter". Code outside that scope must not name this declaration.
Writes chosen whitespace while retaining comment-bearing trivia verbatim.
Methods§
public function token(Token $token, string $separator): voidAppends a token using layout whitespace or its original comment-bearing trivia.
Parameters
$token | Token | |
$separator | string |
Test cases 2
Called from 3
- method-call SqlFormatter\Core\Layout\Elements::write() packages/sql-formatter/src/Core/Layout/Elements.php:37
- method-call SqlFormatter\Core\Layout\Elements::write() packages/sql-formatter/src/Core/Layout/Elements.php:43
- method-call SqlFormatter\Core\Layout\Headers::write() packages/sql-formatter/src/Core/Layout/Headers.php:61
public function finish(string $trailing): stringReturns the result with any final comments preserved.
Parameters
$trailing | string |
Returns
stringTest cases 3
Called from 1
Calls 1
- function-call
trimline 36
Private surface 1§
Implementation details, listed for orientation only.
private string $text = ''Test cases 12§
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 10
SettingsTestcallsFormatterTestcallsBlockTestcallsElementsTestcallsHeadersTest::testWriteAlignsRiverHeadercallsRendererTestcallsFormatterTestcallsDialectTestcallsDialectTestcallsDialectTestcalls
Relations§
Instantiated in 1
Method calls 4
- method-call SqlFormatter\Core\Layout\Elements::write() packages/sql-formatter/src/Core/Layout/Elements.php:37
- method-call SqlFormatter\Core\Layout\Elements::write() packages/sql-formatter/src/Core/Layout/Elements.php:43
- method-call SqlFormatter\Core\Layout\Headers::write() packages/sql-formatter/src/Core/Layout/Headers.php:61
- method-call SqlFormatter\Core\Layout\Renderer::render() packages/sql-formatter/src/Core/Layout/Renderer.php:33
Type declarations 4
- type SqlFormatter\Core\Layout\Block packages/sql-formatter/src/Core/Layout/Block.php:20
- type SqlFormatter\Core\Layout\Elements packages/sql-formatter/src/Core/Layout/Elements.php:20
- type SqlFormatter\Core\Layout\Headers packages/sql-formatter/src/Core/Layout/Headers.php:58
- type SqlFormatter\Core\Layout\Renderer packages/sql-formatter/src/Core/Layout/Renderer.php:17