TemplateGenerator
final class TemplateGenerator
Template code generator.
Methods
void
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 34
void
buildClass(TemplateNode $node, array $features = [])
Builds template class.
at line 45
string
generateCode(string $className, string|null $templateName, bool $strictMode)
Compiles to PHP file
at line 167
void
addMethod(string $name, string $body, string $arguments = '', string $returns = 'void', string|null $comment = null)
| internal |
Adds custom method to template.
at line 185
array
getMethods()
| internal |
Returns custom methods.
at line 195
void
addProperty(string $name, mixed $value)
| internal |
Adds custom property to template.
at line 206
array
getProperties()
| internal |
Returns custom properties.
at line 216
void
addConstant(string $name, mixed $value)
| internal |
Adds custom constant to template.