Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
ScssPhp\ScssPhp\Formatter Class Reference

Base formatter. More...

Inheritance diagram for ScssPhp\ScssPhp\Formatter:
ScssPhp\ScssPhp\Formatter\Compact ScssPhp\ScssPhp\Formatter\Compressed ScssPhp\ScssPhp\Formatter\Crunched ScssPhp\ScssPhp\Formatter\Debug ScssPhp\ScssPhp\Formatter\Expanded ScssPhp\ScssPhp\Formatter\Nested

Public Member Functions

 __construct ()
 Initialize formatter.
 
 customProperty ($name, $value)
 Return custom property assignment differs in that you have to keep spaces in the value as is.
 
 format (OutputBlock $block, SourceMapGenerator $sourceMapGenerator=null)
 Entry point to formatting a block.
 
 property ($name, $value)
 Return property assignment.
 

Public Attributes

string $assignSeparator
 
string $break
 
string $close
 
string $indentChar
 
int $indentLevel
 
bool $keepSemicolons
 
string $open
 
string $tagSeparator
 

Protected Member Functions

 block (OutputBlock $block)
 Output non-empty block.
 
 blockChildren (OutputBlock $block)
 Output block children.
 
 blockLines (OutputBlock $block)
 Output lines inside a block.
 
 blockSelectors (OutputBlock $block)
 Output block selectors.
 
 indentStr ()
 Return indentation (whitespace)
 
 testEmptyChildren ($block)
 Test and clean safely empty children.
 
 write ($str)
 Output content.
 

Protected Attributes

ScssPhp ScssPhp Formatter OutputBlock $currentBlock
 
int $currentColumn
 
int $currentLine
 
ScssPhp ScssPhp SourceMap SourceMapGenerator null $sourceMapGenerator
 
string $strippedSemicolon
 

Detailed Description

Base formatter.

Author
Leaf Corcoran leafo.nosp@m.t@gm.nosp@m.ail.c.nosp@m.om

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ block()

ScssPhp\ScssPhp\Formatter::block ( OutputBlock $block)
protected

Output non-empty block.

Parameters
ScssPhp\ScssPhp\Formatter\OutputBlock$block
Return values
void

Reimplemented in ScssPhp\ScssPhp\Formatter\Debug, and ScssPhp\ScssPhp\Formatter\Nested.

◆ blockChildren()

ScssPhp\ScssPhp\Formatter::blockChildren ( OutputBlock $block)
protected

Output block children.

Parameters
ScssPhp\ScssPhp\Formatter\OutputBlock$block
Return values
void

Reimplemented in ScssPhp\ScssPhp\Formatter\Debug.

◆ blockLines()

ScssPhp\ScssPhp\Formatter::blockLines ( OutputBlock $block)
protected

◆ blockSelectors()

ScssPhp\ScssPhp\Formatter::blockSelectors ( OutputBlock $block)
protected

◆ customProperty()

ScssPhp\ScssPhp\Formatter::customProperty ( $name,
$value )

Return custom property assignment differs in that you have to keep spaces in the value as is.

@api

Parameters
string$name
mixed$value
Return values
string

◆ format()

ScssPhp\ScssPhp\Formatter::format ( OutputBlock $block,
SourceMapGenerator $sourceMapGenerator = null )

Entry point to formatting a block.

@api

Parameters
ScssPhp\ScssPhp\Formatter\OutputBlock$blockAn abstract syntax tree
ScssPhp\ScssPhp\SourceMap\SourceMapGenerator | null$sourceMapGeneratorOptional source map generator
Return values
string

◆ indentStr()

ScssPhp\ScssPhp\Formatter::indentStr ( )
protected

◆ property()

ScssPhp\ScssPhp\Formatter::property ( $name,
$value )

Return property assignment.

@api

Parameters
string$name
mixed$value
Return values
string

◆ testEmptyChildren()

ScssPhp\ScssPhp\Formatter::testEmptyChildren ( $block)
protected

Test and clean safely empty children.

Parameters
ScssPhp\ScssPhp\Formatter\OutputBlock$block
Return values
bool

◆ write()

ScssPhp\ScssPhp\Formatter::write ( $str)
protected

Output content.

Parameters
string$str
Return values
void

The documentation for this class was generated from the following file: