<?php
 class vB_Utility_Template_ParserNode_Tag_Else extends vB_Utility_Template_ParserNode_Tag { public function validate() : array { $errors = []; $parent = $this->main_node->parentNode(); if ($parent->value != 'if') { $errors[] = 'else_not_child_of_if'; } if (count($this->main_node->childNodes()) > 0) { $errors[] = ['tag_cannot_have_content', $this->main_node->value]; } $walk = $this->main_node; while ($walk = $walk->nextSibling()) { if ($walk->type == 'tag' AND $walk->value == 'elseif') { $errors[] = 'elseif_after_else'; break; } } return $errors; } public function compile() : string { return "''"; } } 