\Phug\Formatter\FormatMobileFormat

Summary

Methods
Properties
Constants
__construct()
isWhiteSpaceSensitive()
requireHelper()
__invoke()
setFormatter()
getDebugComment()
format()
removeElementHandler()
setElementHandler()
removePhpTokenHandler()
setPhpTokenHandler()
handleCode()
escapeHtml()
formatCode()
formatBoolean()
formatAttributesList()
handleVariable()
getOptions()
setOptions()
setOptionsRecursive()
setOptionsDefaults()
hasOption()
getOption()
setOption()
unsetOption()
addOptionNameHandlers()
resetOptions()
hasPattern()
setPattern()
addPattern()
addPatterns()
setPatterns()
exportHelper()
No public properties found
DOCTYPE
DOCTYPE_DTD
DOCTYPE_DTD_URL
DOCTYPE_LANGUAGE
SELF_CLOSING_TAG
OPEN_PAIR_TAG
CLOSE_PAIR_TAG
ATTRIBUTE_PATTERN
BOOLEAN_ATTRIBUTE_PATTERN
BUFFER_VARIABLE
CLASS_ATTRIBUTE
STRING_ATTRIBUTE
EXPRESSION_IN_TEXT
EXPRESSION_IN_BOOL
EXPRESSION_IN_BOOL_PHP8
HTML_EXPRESSION_ESCAPE
HTML_TEXT_ESCAPE
PAIR_TAG
TRANSFORM_EXPRESSION
TRANSFORM_CODE
TRANSFORM_RAW_CODE
PHP_HANDLE_CODE
PHP_BLOCK_CODE
PHP_NESTED_HTML
PHP_DISPLAY_CODE
DISPLAY_COMMENT
CUSTOM_DOCTYPE
SAVE_VALUE
DEBUG_COMMENT
isSelfClosingTag()
isBlockTag()
addAttributeAssignment()
hasNonStaticAttributes()
formatAttributeElement()
formatPairTagChildren()
formatPairTag()
yieldAssignmentElement()
formatAssignmentElement()
hasDuplicateAttributeNames()
formatAttributes()
formatMarkupElement()
provideAttributeAssignments()
provideAttributeAssignment()
provideStandAloneAttributeAssignment()
provideMergeAttributes()
provideAttributesAssignment()
provideArrayEscape()
provideClassAttributeAssignment()
provideStyleAttributeAssignment()
provideStandAloneClassAttributeAssignment()
provideStandAloneStyleAttributeAssignment()
getDebugInfo()
getNewLine()
getIndent()
pattern()
handleTokens()
formatAssignmentValue()
formatDynamicValue()
formatPairAsArrayItem()
formatAttributeAsArrayItem()
arrayToPairsExports()
attributesAssignmentsFromPairs()
formatKeywordElement()
formatVariableElement()
formatCodeElement()
formatCommentElement()
formatAttributeValueAccordingToName()
formatExpressionElement()
formatTextElement()
formatDoctypeElement()
formatMixinAttributeValue()
getMixinAttributes()
formatMixinElement()
formatMixinCallElement()
getChildrenIterator()
formatElementChildren()
formatDocumentElement()
throwException()
patternName()
$formatter
$replaceFunction
$recursiveReplaceFunction
$nonDeepOptions
N/A
isInKeywordParams()
isInFunctionParams()
isInInterpolation()
isInExclusionContext()
isInComplexInterpolation()
wrapVariableContext()
handleOptionName()
filterTraversable()
setOptionArrays()
mergeOptionValue()
setDefaultOption()
withVariableReference()
withOptionReference()
$debugCommentPattern
$options
$optionNameHandlers
N/A

Constants

DOCTYPE

DOCTYPE

DOCTYPE_DTD

DOCTYPE_DTD

DOCTYPE_DTD_URL

DOCTYPE_DTD_URL

DOCTYPE_LANGUAGE

DOCTYPE_LANGUAGE

SELF_CLOSING_TAG

SELF_CLOSING_TAG

OPEN_PAIR_TAG

OPEN_PAIR_TAG

CLOSE_PAIR_TAG

CLOSE_PAIR_TAG

ATTRIBUTE_PATTERN

ATTRIBUTE_PATTERN

BOOLEAN_ATTRIBUTE_PATTERN

BOOLEAN_ATTRIBUTE_PATTERN

BUFFER_VARIABLE

BUFFER_VARIABLE

CLASS_ATTRIBUTE

CLASS_ATTRIBUTE

STRING_ATTRIBUTE

STRING_ATTRIBUTE

EXPRESSION_IN_TEXT

EXPRESSION_IN_TEXT

EXPRESSION_IN_BOOL

EXPRESSION_IN_BOOL

EXPRESSION_IN_BOOL_PHP8

EXPRESSION_IN_BOOL_PHP8

HTML_EXPRESSION_ESCAPE

HTML_EXPRESSION_ESCAPE

HTML_TEXT_ESCAPE

HTML_TEXT_ESCAPE

PAIR_TAG

PAIR_TAG

TRANSFORM_EXPRESSION

TRANSFORM_EXPRESSION

TRANSFORM_CODE

TRANSFORM_CODE

TRANSFORM_RAW_CODE

TRANSFORM_RAW_CODE

PHP_HANDLE_CODE

PHP_HANDLE_CODE

PHP_BLOCK_CODE

PHP_BLOCK_CODE

PHP_NESTED_HTML

PHP_NESTED_HTML

PHP_DISPLAY_CODE

PHP_DISPLAY_CODE

DISPLAY_COMMENT

DISPLAY_COMMENT

CUSTOM_DOCTYPE

CUSTOM_DOCTYPE

SAVE_VALUE

SAVE_VALUE

DEBUG_COMMENT

DEBUG_COMMENT

Properties

$replaceFunction

$replaceFunction : callable

Type

callable

$recursiveReplaceFunction

$recursiveReplaceFunction : callable

Type

callable

$nonDeepOptions

$nonDeepOptions : array<mixed,string>

Type

array<mixed,string>

$debugCommentPattern

$debugCommentPattern : string

Type

string

$options

$options : \ArrayObject

Type

\ArrayObject

$optionNameHandlers

$optionNameHandlers : array

Type

array

Methods

__construct()

__construct(\Phug\Formatter  $formatter = null) 

Parameters

\Phug\Formatter $formatter

requireHelper()

requireHelper(  $name) 

Parameters

$name

setFormatter()

setFormatter(\Phug\Formatter  $formatter) : $this

Parameters

\Phug\Formatter $formatter

Returns

$this

getDebugComment()

getDebugComment(  $nodeId) 

Parameters

$nodeId

format()

format(  $element, boolean  $noDebug = false) : string

Parameters

$element
boolean $noDebug

Returns

string

removeElementHandler()

removeElementHandler(  $className) : $this

Parameters

$className

Returns

$this

setElementHandler()

setElementHandler(  $className, callable  $handler) : $this

Parameters

$className
callable $handler

Returns

$this

removePhpTokenHandler()

removePhpTokenHandler(  $phpTokenId) : $this

Parameters

$phpTokenId

Returns

$this

setPhpTokenHandler()

setPhpTokenHandler(  $phpTokenId,   $handler) : $this

Parameters

$phpTokenId
$handler

Returns

$this

handleCode()

handleCode(string  $phpCode) : string

Handle PHP code with the pattern php_handle_code.

Parameters

string $phpCode

Returns

string

escapeHtml()

escapeHtml(string  $expression) : string

Apply html_expression_escape pattern.

Parameters

string $expression

Returns

string

formatCode()

formatCode(string  $code, boolean  $checked, boolean  $noTransformation = false) : string

Format a code with transform_expression and tokens handlers.

Parameters

string $code
boolean $checked
boolean $noTransformation

Returns

string

formatBoolean()

formatBoolean(string  $code) : string

Return an expression to be casted as boolean according to expression_in_bool pattern.

Parameters

string $code

expression input code.

Returns

string

handleVariable()

handleVariable(  $variable,   $index,   $tokens,   $checked) 

Parameters

$variable
$index
$tokens
$checked

getOptions()

getOptions() 

{@inheritdoc}

setOptions()

setOptions(  $options) 

{@inheritdoc}

Parameters

$options

setOptionsRecursive()

setOptionsRecursive(  $options) 

{@inheritdoc}

Parameters

$options

setOptionsDefaults()

setOptionsDefaults(  $options = null) 

{@inheritdoc}

Parameters

$options

hasOption()

hasOption(  $name) 

{@inheritdoc}

Parameters

$name

getOption()

getOption(  $name) 

{@inheritdoc}

Parameters

$name

setOption()

setOption(  $name,   $value) 

{@inheritdoc}

Parameters

$name
$value

unsetOption()

unsetOption(  $name) 

{@inheritdoc}

Parameters

$name

addOptionNameHandlers()

addOptionNameHandlers(callable  $handler) 

Parameters

callable $handler

resetOptions()

resetOptions() 

hasPattern()

hasPattern(  $name) : boolean

Parameters

$name

Returns

boolean

addPatterns()

addPatterns(  $patterns) : $this

Parameters

$patterns

Returns

$this

setPatterns()

setPatterns(  $patterns) : $this

Parameters

$patterns

Returns

$this

exportHelper()

exportHelper(array  $name, array  $arguments = null) : string

Parameters

array $name
array $arguments

Returns

string

isSelfClosingTag()

isSelfClosingTag(\Phug\Formatter\MarkupInterface  $element,   $isSelfClosing = null) 

Parameters

\Phug\Formatter\MarkupInterface $element
$isSelfClosing

addAttributeAssignment()

addAttributeAssignment(  $name,   $handler) 

Parameters

$name
$handler

yieldAssignmentElement()

yieldAssignmentElement(\Phug\Formatter\Element\AssignmentElement  $element) : \Phug\Formatter\Format\iterable

Parameters

\Phug\Formatter\Element\AssignmentElement $element

Throws

\Phug\FormatterException

Returns

\Phug\Formatter\Format\iterable

formatAssignmentElement()

formatAssignmentElement(\Phug\Formatter\Element\AssignmentElement  $element) : string

Parameters

\Phug\Formatter\Element\AssignmentElement $element

Throws

\Phug\FormatterException

Returns

string

provideAttributeAssignments()

provideAttributeAssignments() : $this

Returns

$this

provideAttributeAssignment()

provideAttributeAssignment() : $this

Returns

$this

provideStandAloneAttributeAssignment()

provideStandAloneAttributeAssignment() : $this

Returns

$this

provideMergeAttributes()

provideMergeAttributes() : $this

Returns

$this

provideAttributesAssignment()

provideAttributesAssignment() : $this

Returns

$this

provideArrayEscape()

provideArrayEscape() : $this

Returns

$this

provideClassAttributeAssignment()

provideClassAttributeAssignment() : $this

Returns

$this

provideStyleAttributeAssignment()

provideStyleAttributeAssignment() : $this

Returns

$this

provideStandAloneClassAttributeAssignment()

provideStandAloneClassAttributeAssignment() : $this

Returns

$this

provideStandAloneStyleAttributeAssignment()

provideStandAloneStyleAttributeAssignment() : $this

Returns

$this

getDebugInfo()

getDebugInfo(  $element) 

Parameters

$element

getNewLine()

getNewLine() 

getIndent()

getIndent() 

pattern()

pattern(  $patternOption) 

Parameters

$patternOption

handleTokens()

handleTokens(  $code,   $checked) 

Parameters

$code
$checked

formatAssignmentValue()

formatAssignmentValue(  $value) 

Parameters

$value

formatDynamicValue()

formatDynamicValue(  $formattedName,   $value) 

Parameters

$formattedName
$value

formatPairAsArrayItem()

formatPairAsArrayItem(  $name,   $value) 

Parameters

$name
$value

arrayToPairsExports()

arrayToPairsExports(  $array) 

Parameters

$array

attributesAssignmentsFromPairs()

attributesAssignmentsFromPairs(  $pairs,   $helper = 'attributes_assignment') 

Parameters

$pairs
$helper

formatAttributeValueAccordingToName()

formatAttributeValueAccordingToName(  $value,   $name,   $checked) 

Parameters

$value
$name
$checked

formatMixinAttributeValue()

formatMixinAttributeValue(  $value) 

Parameters

$value

getMixinAttributes()

getMixinAttributes(\SplObjectStorage  $source) 

Parameters

\SplObjectStorage $source

formatElementChildren()

formatElementChildren(\Phug\Formatter\ElementInterface  $element,   $indentStep = 1) 

Parameters

\Phug\Formatter\ElementInterface $element
$indentStep

patternName()

patternName(  $name) 

Parameters

$name

isInKeywordParams()

isInKeywordParams(  $tokens,   $index) 

Parameters

$tokens
$index

isInFunctionParams()

isInFunctionParams(  $tokens,   $index) 

Parameters

$tokens
$index

isInInterpolation()

isInInterpolation(  $tokens,   $index) 

Parameters

$tokens
$index

isInExclusionContext()

isInExclusionContext(  $tokens,   $index) 

Parameters

$tokens
$index

isInComplexInterpolation()

isInComplexInterpolation(  $tokens,   $index) 

Parameters

$tokens
$index

wrapVariableContext()

wrapVariableContext(  $expression,   $tokens,   $index) 

Parameters

$expression
$tokens
$index

handleOptionName()

handleOptionName(string  $name) : string

Parameters

string $name

Returns

string

filterTraversable()

filterTraversable(  $values) 

Parameters

$values

setOptionArrays()

setOptionArrays(array  $arrays, string  $functionName) : $this

Parameters

array $arrays
string $functionName

Returns

$this

mergeOptionValue()

mergeOptionValue(  $name,   $current,   $addedValue,   $functionName) 

Parameters

$name
$current
$addedValue
$functionName

setDefaultOption()

setDefaultOption(  $key,   $value) 

Parameters

$key
$value

withVariableReference()

withVariableReference(mixed  $variable,   $name, callable  $callback) : \Phug\Util\Partial\&$options

Parameters

mixed $variable
$name
callable $callback

Returns

\Phug\Util\Partial\&$options

withOptionReference()

withOptionReference(  $name, callable  $callback) : \Phug\Util\Partial\&$options

Parameters

$name
callable $callback

Returns

\Phug\Util\Partial\&$options