Formatter
in package
Base formatter
Tags
Table of Contents
- $assignSeparator : string
- $break : string
- $close : string
- $indentChar : string
- $indentLevel : int
- $keepSemicolons : bool
- $open : string
- $tagSeparator : string
- $currentBlock : OutputBlock
- $currentColumn : int
- $currentLine : int
- $sourceMapGenerator : SourceMapGenerator
- __construct() : mixed
- Initialize formatter
- format() : string
- Entry point to formatting a block
- property() : string
- Return property assignment
- stripSemicolon() : mixed
- Strip semi-colon appended by property(); it's a separator, not a terminator
- block() : mixed
- Output non-empty block
- blockChildren() : mixed
- Output block children
- blockLines() : mixed
- Output lines inside a block
- blockSelectors() : mixed
- Output block selectors
- indentStr() : string
- Return indentation (whitespace)
- write() : mixed
Properties
$assignSeparator
public
string
$assignSeparator
$break
public
string
$break
$close
public
string
$close
$indentChar
public
string
$indentChar
$indentLevel
public
int
$indentLevel
$keepSemicolons
public
bool
$keepSemicolons
$open
public
string
$open
$tagSeparator
public
string
$tagSeparator
$currentBlock
protected
OutputBlock
$currentBlock
$currentColumn
protected
int
$currentColumn
$currentLine
protected
int
$currentLine
$sourceMapGenerator
protected
SourceMapGenerator
$sourceMapGenerator
Methods
__construct()
Initialize formatter
public
abstract __construct() : mixed
Return values
mixed —format()
Entry point to formatting a block
public
format(OutputBlock $block[, SourceMapGenerator|null $sourceMapGenerator = null ]) : string
Parameters
- $block : OutputBlock
-
An abstract syntax tree
- $sourceMapGenerator : SourceMapGenerator|null = null
-
Optional source map generator
Return values
string —property()
Return property assignment
public
property(string $name, mixed $value) : string
Parameters
- $name : string
- $value : mixed
Return values
string —stripSemicolon()
Strip semi-colon appended by property(); it's a separator, not a terminator
public
stripSemicolon(array<string|int, mixed> &$lines) : mixed
Parameters
- $lines : array<string|int, mixed>
Return values
mixed —block()
Output non-empty block
protected
block(OutputBlock $block) : mixed
Parameters
- $block : OutputBlock
Return values
mixed —blockChildren()
Output block children
protected
blockChildren(OutputBlock $block) : mixed
Parameters
- $block : OutputBlock
Return values
mixed —blockLines()
Output lines inside a block
protected
blockLines(OutputBlock $block) : mixed
Parameters
- $block : OutputBlock
Return values
mixed —blockSelectors()
Output block selectors
protected
blockSelectors(OutputBlock $block) : mixed
Parameters
- $block : OutputBlock
Return values
mixed —indentStr()
Return indentation (whitespace)
protected
indentStr() : string
Return values
string —write()
protected
write(string $str) : mixed
Parameters
- $str : string