Class to handle compiling template function calls for "calc"

package XenForo_Template

 Methods

Compile the function and return PHP handle it.

compile(\XenForo_Template_Compiler $compiler, string $function, array $arguments, array $options) : string

Parameters

$compiler

\XenForo_Template_Compiler

The invoking compiler

$function

string

Name of the function called

$arguments

array

Arguments to the function (should have at least 1)

$options

array

Compilation options

Returns

string

Parses the math expression.

_parseMathExpression(\XenForo_Template_Compiler $compiler, string $expression, array $placeholders, boolean $internalExpression, boolean $isFunction) : string

"?" values represent placeholders for variables. Returns valid PHP code for the expression.

Parameters

$compiler

\XenForo_Template_Compiler

The invoking compiler

$expression

string

The expression to parse. This value will be modified.

$placeholders

array

Placeholders to replace "?" with. This value will be modified.

$internalExpression

boolean

True if parsing an internal expression (with parens)

$isFunction

boolean

True if parsing a function (allows commas to separate args)

Returns

stringPHP code