Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
decideStopwatchEnd example
public
function
parse
(
Token
$token
)
: Node
{
$lineno
=
$token
->
getLine
(
)
;
$stream
=
$this
->parser->
getStream
(
)
;
// {% stopwatch 'bar' %}
$name
=
$this
->parser->
getExpressionParser
(
)
->
parseExpression
(
)
;
$stream
->
expect
(
Token::BLOCK_END_TYPE
)
;
// {% endstopwatch %}
$body
=
$this
->parser->
subparse
(
$this
->
decideStopwatchEnd
(
...
)
, true
)
;
$stream
->
expect
(
Token::BLOCK_END_TYPE
)
;
if
(
$this
->stopwatchIsAvailable
)
{
return
new
StopwatchNode
(
$name
,
$body
,
new
AssignNameExpression
(
$this
->parser->
getVarName
(
)
,
$token
->
getLine
(
)
)
,
$lineno
,
$this
->
getTag
(
)
)
;
}
return
$body
;
}
public
function
decideStopwatchEnd
(
Token
$token
)
: bool
{