class Compiler implements ResetInterface

Compiles a node to PHP code.

Methods

__construct(array $functions)

No description

getFunction($name)

No description

string
getSource()

Gets the current PHP code after compilation.

reset()

No description

$this
compile(Node $node)

Compiles a node.

subcompile(Node $node)

No description

$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