Parser
in package
Tags
Table of Contents
Properties
- $blocks : mixed
- $blockStack : mixed
- $embeddedTemplates : mixed
- $env : Environment
- $expressionParser : mixed
- $expressionRefs : WeakMap|null
- $ignoreUnknownTwigCallables : mixed
- $importedSymbols : mixed
- $macros : mixed
- $parent : mixed
- $parsers : ExpressionParsers
- $stack : mixed
- $stream : mixed
- $traits : mixed
- $varNameSalt : mixed
- $visitors : mixed
Methods
- __construct() : mixed
- addImportedSymbol() : void
- addTrait() : void
- embedTemplate() : void
- getBlock() : Node
- getBlockStack() : array<string|int, mixed>
- getCurrentToken() : Token
- getEnvironment() : Environment
- getExpressionParser() : ExpressionParser
- getFilter() : TwigFilter
- getFunction() : TwigFunction
- getImportedSymbol() : AssignTemplateVariable|null}|null
- getParent() : Node|null
- getStream() : TokenStream
- getTest() : TwigTest
- getVarName() : string
- hasBlock() : bool
- hasInheritance() : bool
- hasMacro() : bool
- hasTraits() : bool
- isMainScope() : bool
- parse() : ModuleNode
- parseExpression() : AbstractExpression
- peekBlockStack() : string|null
- popBlockStack() : void
- popLocalScope() : void
- pushBlockStack() : void
- pushLocalScope() : void
- setBlock() : void
- setMacro() : void
- setParent() : void
- shouldIgnoreUnknownTwigCallables() : bool
- subparse() : Node
- subparseIgnoreUnknownTwigCallables() : void
- checkPrecedenceDeprecations() : mixed
- filterBodyNodes() : Node|null
Properties
$blocks
private
mixed
$blocks
$blockStack
private
mixed
$blockStack
$embeddedTemplates
private
mixed
$embeddedTemplates
= []
$env
private
Environment
$env
$expressionParser
private
mixed
$expressionParser
$expressionRefs
private
WeakMap|null
$expressionRefs
= null
$ignoreUnknownTwigCallables
private
mixed
$ignoreUnknownTwigCallables
= false
$importedSymbols
private
mixed
$importedSymbols
$macros
private
mixed
$macros
$parent
private
mixed
$parent
$parsers
private
ExpressionParsers
$parsers
$stack
private
mixed
$stack
= []
$stream
private
mixed
$stream
$traits
private
mixed
$traits
$varNameSalt
private
mixed
$varNameSalt
= 0
$visitors
private
mixed
$visitors
Methods
__construct()
public
__construct(Environment $env) : mixed
Parameters
- $env : Environment
addImportedSymbol()
public
addImportedSymbol(string $type, string $alias[, string|null $name = null ][, AbstractExpression|AssignTemplateVariable|null $internalRef = null ]) : void
Parameters
- $type : string
- $alias : string
- $name : string|null = null
- $internalRef : AbstractExpression|AssignTemplateVariable|null = null
addTrait()
public
addTrait(mixed $trait) : void
Parameters
- $trait : mixed
embedTemplate()
public
embedTemplate(ModuleNode $template) : void
Parameters
- $template : ModuleNode
getBlock()
public
getBlock(string $name) : Node
Parameters
- $name : string
Return values
NodegetBlockStack()
public
getBlockStack() : array<string|int, mixed>
Return values
array<string|int, mixed>getCurrentToken()
public
getCurrentToken() : Token
Return values
TokengetEnvironment()
public
getEnvironment() : Environment
Return values
EnvironmentgetExpressionParser()
public
getExpressionParser() : ExpressionParser
since Twig 3.21
Return values
ExpressionParsergetFilter()
public
getFilter(string $name, int $line) : TwigFilter
Parameters
- $name : string
- $line : int
Return values
TwigFiltergetFunction()
public
getFunction(string $name, int $line) : TwigFunction
Parameters
- $name : string
- $line : int
Return values
TwigFunctiongetImportedSymbol()
public
getImportedSymbol(string $type, string $alias) : AssignTemplateVariable|null}|null
Parameters
- $type : string
- $alias : string
Return values
AssignTemplateVariable|null}|nullgetParent()
public
getParent() : Node|null
Return values
Node|nullgetStream()
public
getStream() : TokenStream
Return values
TokenStreamgetTest()
public
getTest(int $line) : TwigTest
Parameters
- $line : int
Return values
TwigTestgetVarName()
public
getVarName() : string
Return values
stringhasBlock()
public
hasBlock(string $name) : bool
Parameters
- $name : string
Return values
boolhasInheritance()
public
hasInheritance() : bool
Return values
boolhasMacro()
public
hasMacro(string $name) : bool
Parameters
- $name : string
Return values
boolhasTraits()
public
hasTraits() : bool
Return values
boolisMainScope()
public
isMainScope() : bool
Return values
boolparse()
public
parse(TokenStream $stream[, mixed $test = null ][, bool $dropNeedle = false ]) : ModuleNode
Parameters
- $stream : TokenStream
- $test : mixed = null
- $dropNeedle : bool = false
Tags
Return values
ModuleNodeparseExpression()
public
parseExpression([int $precedence = 0 ]) : AbstractExpression
Parameters
- $precedence : int = 0
Return values
AbstractExpressionpeekBlockStack()
public
peekBlockStack() : string|null
Return values
string|nullpopBlockStack()
public
popBlockStack() : void
popLocalScope()
public
popLocalScope() : void
pushBlockStack()
public
pushBlockStack(mixed $name) : void
Parameters
- $name : mixed
pushLocalScope()
public
pushLocalScope() : void
setBlock()
public
setBlock(string $name, BlockNode $value) : void
Parameters
- $name : string
- $value : BlockNode
setMacro()
public
setMacro(string $name, MacroNode $node) : void
Parameters
- $name : string
- $node : MacroNode
setParent()
public
setParent(Node|null $parent) : void
Parameters
- $parent : Node|null
shouldIgnoreUnknownTwigCallables()
public
shouldIgnoreUnknownTwigCallables() : bool
Return values
boolsubparse()
public
subparse(mixed $test[, bool $dropNeedle = false ]) : Node
Parameters
- $test : mixed
- $dropNeedle : bool = false
Tags
Return values
NodesubparseIgnoreUnknownTwigCallables()
public
subparseIgnoreUnknownTwigCallables(mixed $test[, bool $dropNeedle = false ]) : void
Parameters
- $test : mixed
- $dropNeedle : bool = false
checkPrecedenceDeprecations()
private
checkPrecedenceDeprecations(ExpressionParserInterface $expressionParser, AbstractExpression $expr) : mixed
Parameters
- $expressionParser : ExpressionParserInterface
- $expr : AbstractExpression
filterBodyNodes()
private
filterBodyNodes(Node $node[, bool $nested = false ]) : Node|null
Parameters
- $node : Node
- $nested : bool = false