<?php
 class vB_Utility_Template_ParserNode_Curly_Php extends vB_Utility_Template_ParserNode_Curly { public function validate() : array { $errors = []; $attributecount = sizeof($this->main_node->attributes); if ($attributecount == 0) { $errors[] = 'no_function_specified'; } $function_name = $this->main_node->attributes[0]; if (!(in_array($function_name, self::$safeFunctions) OR in_array($function_name, self::$safePhpFunctions))) { $errors[] = ['invalid_function_specified', $function_name]; } return $errors; } public function compile() : string { $function_name = $this->main_node->attributes[0]; $arguments = []; $attributes = array_slice($this->main_node->attributes, 1); foreach ($attributes AS $attribute) { if ($attribute instanceof vB_CurlyNode) { $attribute->refParam = true; } $arguments[] = $this->attributeToString($attribute); } return $function_name . '(' . implode(', ', $arguments) . ')'; } } 