<?php
 class vB_Utility_Template_ParserNode_Curly_Set 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'; } if ($attributecount > 2) { $errors[] = 'too_many_attributes'; } return $errors; } public function compile() : string { if ($this->main_node->attributes[0] instanceof vB_CurlyNode AND in_array($this->main_node->attributes[0]->value, ['raw', 'var'])) { $string = $this->main_node->attributes[0]->attributes[0]; $string = ($string[0] !== '$' ? '$' : '') . $string; } else { $string = $this->compileVar($this->main_node->attributes[0]); } $argument = $this->attributeToString($this->main_node->attributes[1]); return "''; $string = $argument;" . ' $final_rendered .= \'\''; } } 