final class TemplateGenerator

Template code generator.

Methods

void
buildClass(TemplateNode $node, bool $migrationWarnings)

Builds template class.

string
generateCode(string $className, string|null $templateName, bool $strictMode)

Compiles to PHP file

void
addMethod(string $name, string $body, string $arguments = '', string $returns = 'void', string|null $comment = null)

Adds custom method to template.

array
getMethods()

Returns custom methods.

void
addProperty(string $name, mixed $value)

Adds custom property to template.

array
getProperties()

Returns custom properties.

void
addConstant(string $name, mixed $value)

Adds custom constant to template.

Details

at line 35
void buildClass(TemplateNode $node, bool $migrationWarnings)

Builds template class.

Parameters

TemplateNode $node
bool $migrationWarnings

Return Value

void

at line 46
string generateCode(string $className, string|null $templateName, bool $strictMode)

Compiles to PHP file

Parameters

string $className
string|null $templateName
bool $strictMode

Return Value

string

at line 165
void addMethod(string $name, string $body, string $arguments = '', string $returns = 'void', string|null $comment = null)

internal  
 

Adds custom method to template.

Parameters

string $name
string $body
string $arguments
string $returns
string|null $comment

Return Value

void

at line 183
array getMethods()

internal  
 

Returns custom methods.

Return Value

array

at line 193
void addProperty(string $name, mixed $value)

internal  
 

Adds custom property to template.

Parameters

string $name
mixed $value

Return Value

void

at line 204
array getProperties()

internal  
 

Returns custom properties.

Return Value

array

at line 214
void addConstant(string $name, mixed $value)

internal  
 

Adds custom constant to template.

Parameters

string $name
mixed $value

Return Value

void