<?php
 class vB_Utility_Template_ParserNode_Tag_Elseif extends vB_Utility_Template_ParserNode_Tag { public function validate() : array { $errors = []; $parent = $this->main_node->parentNode(); if ($parent->value != 'if') { $errors[] = ['elseif_not_child_of_if']; } if (count($this->main_node->childNodes()) > 0) { $errors[] = ['tag_cannot_have_content', $this->main_node->value]; } if (trim($this->main_node->attributes['condition'] ?? '') === '') { $errors[] = ['empty_if_condition']; } else { $errors = array_merge($errors, $this->validateCondition($this->main_node->attributes['condition'])); } return $errors; } public function compile() : string { return "''"; } } 