W3cubDocs

/Symfony 3.0

Symfony\Component\ExpressionLanguage\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()
Compiler compile(Node $node)

Compiles a node.

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

Adds a raw string to the compiled code.

Compiler string(string $value)

Adds a quoted string to the compiled code.

Compiler repr(mixed $value)

Returns a PHP representation of a given value.

Details

public __construct(array $functions)

Parameters

array $functions

public getFunction($name)

Parameters

$name

public string getSource()

Gets the current PHP code after compilation.

Return Value

string The PHP code

public reset()

public Compiler compile(Node $node)

Compiles a node.

Parameters

Node $node The node to compile

Return Value

Compiler The current compiler instance

public subcompile(Node $node)

Parameters

Node $node

public Compiler raw(string $string)

Adds a raw string to the compiled code.

Parameters

string $string The string

Return Value

Compiler The current compiler instance

public Compiler string(string $value)

Adds a quoted string to the compiled code.

Parameters

string $value The string

Return Value

Compiler The current compiler instance

public Compiler repr(mixed $value)

Returns a PHP representation of a given value.

Parameters

mixed $value The value to convert

Return Value

Compiler The current compiler instance

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/ExpressionLanguage/Compiler.html