public function createTemplate(string
$template, string
$name = null
): TemplateWrapper
{ $hash =
hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128',
$template, false
);
if (null !==
$name) { $name =
sprintf('%s (string template %s)',
$name,
$hash);
} else { $name =
sprintf('__string_template__%s',
$hash);
} $loader =
new ChainLoader([ new ArrayLoader([$name =>
$template]),
$current =
$this->
getLoader(),
]);
$this->
setLoader($loader);
try { return new TemplateWrapper($this,
$this->
loadTemplate($this->
getTemplateClass($name),
$name));
} finally { $this->
setLoader($current);
} }