Merge branch '3.x' into 4.x

* 3.x:
  Remove the templateClassPrefix property on Environment
This commit is contained in:
Fabien Potencier
2024-07-31 22:49:39 +02:00
2 changed files with 1 additions and 6 deletions
+1 -2
View File
@@ -68,7 +68,6 @@ class Environment
*/
private array $loadedTemplates;
private bool $strictVariables;
private string $templateClassPrefix = '__TwigTemplate_';
private CacheInterface|string|false $originalCache;
private ExtensionSet $extensionSet;
/**
@@ -280,7 +279,7 @@ class Environment
{
$key = $this->getLoader()->getCacheKey($name).$this->optionsHash;
return $this->templateClassPrefix.hash('xxh128', $key).(null === $index ? '' : '___'.$index);
return '__TwigTemplate_'.hash('xxh128', $key).(null === $index ? '' : '___'.$index);
}
/**
-4
View File
@@ -186,10 +186,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->setValue($twig, '__TwigTemplate_'.hash('xxh128', random_bytes(32), false).'_');
$deprecations = [];
try {
$prevHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$deprecations, &$prevHandler) {