private function detectTemplate()
{
foreach ($this->lexer->getTokens() as $token) {
if (!is_array($token)) {
continue;
}
$templateEndTokens = [T_ENDIF => 1, T_ENDFOREACH => 1, T_ENDFOR => 1, T_ENDWHILE => 1];
if (!isset($templateEndTokens[$token[0]])) {
continue;
}
if (Strings::startsWith($token[1], 'end')) {
throw new TemplateSkippedException();
}
}
}