W3cubDocs

/Symfony 4.1

Compiler

class Compiler

Compiles a node to PHP code.

Methods

__construct(array $functions)
getFunction($name)
string getSource()

Gets the current PHP code after compilation.

reset()
$this compile(Node $node)

Compiles a node.

subcompile(Node $node)
$this raw(string $string)

Adds a raw string to the compiled code.

$this string(string $value)

Adds a quoted string to the compiled code.

$this repr(mixed $value)

Returns a PHP representation of a given value.

Details

__construct(array $functions)

Parameters

array $functions

getFunction($name)

Parameters

$name

string getSource()

Gets the current PHP code after compilation.

Return Value

string The PHP code

reset()

$this compile(Node $node)

Compiles a node.

Parameters

Node $node

Return Value

$this

subcompile(Node $node)

Parameters

Node $node

$this raw(string $string)

Adds a raw string to the compiled code.

Parameters

string $string The string

Return Value

$this

$this string(string $value)

Adds a quoted string to the compiled code.

Parameters

string $value The string

Return Value

$this

$this repr(mixed $value)

Returns a PHP representation of a given value.

Parameters

mixed $value The value to convert

Return Value

$this

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/ExpressionLanguage/Compiler.html