mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-06 15:37:58 +00:00
Remove the templateClassPrefix property on Environment
This commit is contained in:
+1
-2
@@ -63,7 +63,6 @@ class Environment
|
||||
private $resolvedGlobals;
|
||||
private $loadedTemplates;
|
||||
private $strictVariables;
|
||||
private $templateClassPrefix = '__TwigTemplate_';
|
||||
private $originalCache;
|
||||
private $extensionSet;
|
||||
private $runtimeLoaders = [];
|
||||
@@ -290,7 +289,7 @@ class Environment
|
||||
{
|
||||
$key = $this->getLoader()->getCacheKey($name).$this->optionsHash;
|
||||
|
||||
return $this->templateClassPrefix.hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $key).(null === $index ? '' : '___'.$index);
|
||||
return '__TwigTemplate_'.hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $key).(null === $index ? '' : '___'.$index);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -185,11 +185,6 @@ abstract class IntegrationTestCase extends TestCase
|
||||
$twig->addFunction($function);
|
||||
}
|
||||
|
||||
// avoid using the same PHP class name for different cases
|
||||
$p = new \ReflectionProperty($twig, 'templateClassPrefix');
|
||||
$p->setAccessible(true);
|
||||
$p->setValue($twig, '__TwigTemplate_'.hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', random_bytes(32), false).'_');
|
||||
|
||||
$deprecations = [];
|
||||
try {
|
||||
$prevHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$deprecations, &$prevHandler) {
|
||||
|
||||
Reference in New Issue
Block a user