Compiler
in package
implements
ResetInterface
Compiles a node to PHP code.
Tags
Table of Contents
Interfaces
- ResetInterface
- Provides a way to reset an object to its initial state.
Properties
- $functions : array<string|int, mixed>
- $source : string
Methods
- __construct() : mixed
- compile() : $this
- Compiles a node.
- getFunction() : mixed
- getSource() : string
- Gets the current PHP code after compilation.
- raw() : $this
- Adds a raw string to the compiled code.
- repr() : $this
- Returns a PHP representation of a given value.
- reset() : $this
- string() : $this
- Adds a quoted string to the compiled code.
- subcompile() : mixed
Properties
$functions
private
array<string|int, mixed>
$functions
$source
private
string
$source
= ''
Methods
__construct()
public
__construct(array<string|int, mixed> $functions) : mixed
Parameters
- $functions : array<string|int, mixed>
compile()
Compiles a node.
public
compile(Node $node) : $this
Parameters
- $node : Node
Return values
$thisgetFunction()
public
getFunction(string $name) : mixed
Parameters
- $name : string
getSource()
Gets the current PHP code after compilation.
public
getSource() : string
Return values
stringraw()
Adds a raw string to the compiled code.
public
raw(string $string) : $this
Parameters
- $string : string
Return values
$thisrepr()
Returns a PHP representation of a given value.
public
repr(mixed $value) : $this
Parameters
- $value : mixed
Return values
$thisreset()
public
reset() : $this
Return values
$thisstring()
Adds a quoted string to the compiled code.
public
string(string $value) : $this
Parameters
- $value : string
Return values
$thissubcompile()
public
subcompile(Node $node) : mixed
Parameters
- $node : Node