<?php
 class vB_Utility_Template_ParserNode_Curly_Strcat extends vB_Utility_Template_ParserNode_Curly { public function validate() : array { $errors = []; $attributecount = sizeof($this->main_node->attributes); if ($attributecount == 0) { $errors[] = 'no_variable_specified'; } if ($attributecount < 2) { $errors[] = 'too_few_attributes'; } return $errors; } public function compile() : string { $arguments = $this->getRenderedAttributes(1); $arguments = implode(' . ', array_filter($arguments)); $var_name = $this->main_node->attributes[0]; if ($var_name instanceof vB_CurlyNode AND in_array($var_name->value, ['raw', 'var'])) { $string = $var_name->attributes[0]; $string = ($string[0] !== '$' ? '$' : '') . $string; } else { $string = $this->compileVar($var_name); } return "''; $string .= $arguments;" . ' $final_rendered .= \'\''; } } 