mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-06 07:27:17 +00:00
Remove usage of uniqid
This commit is contained in:
@@ -188,7 +188,7 @@ abstract class IntegrationTestCase extends TestCase
|
||||
// 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', uniqid((string) mt_rand(), true), false).'_');
|
||||
$p->setValue($twig, '__TwigTemplate_'.hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', random_bytes(32), false).'_');
|
||||
|
||||
$deprecations = [];
|
||||
try {
|
||||
|
||||
@@ -23,7 +23,7 @@ class FilesystemTest extends TestCase
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$nonce = hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', uniqid((string) mt_rand(), true));
|
||||
$nonce = hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', random_bytes(32));
|
||||
$this->classname = '__Twig_Tests_Cache_FilesystemTest_Template_'.$nonce;
|
||||
$this->directory = sys_get_temp_dir().'/twig-test';
|
||||
$this->cache = new FilesystemCache($this->directory);
|
||||
|
||||
Reference in New Issue
Block a user