diff --git a/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php b/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php index 0a2a87f81..66ceabadb 100644 --- a/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php +++ b/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php @@ -32,7 +32,7 @@ final class ProfilerNodeVisitor implements NodeVisitorInterface public function __construct( private string $extensionName, ) { - $this->varName = \sprintf('__internal_%s', hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', $extensionName)); + $this->varName = \sprintf('__internal_%s', hash('xxh128', $extensionName)); } public function enterNode(Node $node, Environment $env): Node diff --git a/src/Util/CallableArgumentsExtractor.php b/src/Util/CallableArgumentsExtractor.php index 8811ca9c8..0c532093b 100644 --- a/src/Util/CallableArgumentsExtractor.php +++ b/src/Util/CallableArgumentsExtractor.php @@ -77,12 +77,10 @@ final class CallableArgumentsExtractor $pos = 0; foreach ($callableParameters as $callableParameter) { $name = $this->normalizeName($callableParameter->name); - if (\PHP_VERSION_ID >= 80000 && 'range' === $callable) { - if ('start' === $name) { - $name = 'low'; - } elseif ('end' === $name) { - $name = 'high'; - } + if ('range' === $callable && 'start' === $name) { + $name = 'low'; + } elseif ('range' === $callable && 'end' === $name) { + $name = 'high'; } $names[] = $name; diff --git a/tests/Cache/ChainTest.php b/tests/Cache/ChainTest.php index 3120ab188..5f53caa4d 100644 --- a/tests/Cache/ChainTest.php +++ b/tests/Cache/ChainTest.php @@ -25,7 +25,7 @@ class ChainTest extends TestCase protected function setUp(): void { - $nonce = hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', random_bytes(32)); + $nonce = hash('xxh128', random_bytes(32)); $this->className = '__Twig_Tests_Cache_ChainTest_Template_'.$nonce; $this->directory = sys_get_temp_dir().'/twig-test'; $this->cache = new ChainCache([ diff --git a/tests/Cache/ReadOnlyFilesystemTest.php b/tests/Cache/ReadOnlyFilesystemTest.php index 34bc14f88..da533985f 100644 --- a/tests/Cache/ReadOnlyFilesystemTest.php +++ b/tests/Cache/ReadOnlyFilesystemTest.php @@ -23,7 +23,7 @@ class ReadOnlyFilesystemTest extends TestCase protected function setUp(): void { - $nonce = hash(\PHP_VERSION_ID < 80100 ? 'sha256' : 'xxh128', random_bytes(32)); + $nonce = hash('xxh128', random_bytes(32)); $this->className = '__Twig_Tests_Cache_ReadOnlyFilesystemTest_Template_'.$nonce; $this->directory = sys_get_temp_dir().'/twig-test'; $this->cache = new ReadOnlyFilesystemCache($this->directory); diff --git a/tests/Fixtures/functions/enum_cases/invalid_dynamic_enum.test b/tests/Fixtures/functions/enum_cases/invalid_dynamic_enum.test index 2a6008bba..665e3e8d5 100644 --- a/tests/Fixtures/functions/enum_cases/invalid_dynamic_enum.test +++ b/tests/Fixtures/functions/enum_cases/invalid_dynamic_enum.test @@ -1,7 +1,5 @@ --TEST-- "enum_cases" function with invalid dynamic enum class ---CONDITION-- -\PHP_VERSION_ID >= 80100 --TEMPLATE-- {% set from_variable = 'Twig\\Tests\\NonExistentEnum' %} {% for c in enum_cases(from_variable) %} diff --git a/tests/Fixtures/functions/enum_cases/invalid_enum.test b/tests/Fixtures/functions/enum_cases/invalid_enum.test index 3084c37e3..7bdf21a46 100644 --- a/tests/Fixtures/functions/enum_cases/invalid_enum.test +++ b/tests/Fixtures/functions/enum_cases/invalid_enum.test @@ -1,7 +1,5 @@ --TEST-- "enum_cases" function with invalid enum class ---CONDITION-- -\PHP_VERSION_ID >= 80100 --TEMPLATE-- {% for c in enum_cases('Twig\\Tests\\NonExistentEnum') %} {{~ c.name }} diff --git a/tests/Fixtures/functions/enum_cases/invalid_literal_type.test b/tests/Fixtures/functions/enum_cases/invalid_literal_type.test index 6e7945d00..7009d810d 100644 --- a/tests/Fixtures/functions/enum_cases/invalid_literal_type.test +++ b/tests/Fixtures/functions/enum_cases/invalid_literal_type.test @@ -1,7 +1,5 @@ --TEST-- "enum_cases" function with invalid literal type ---CONDITION-- -\PHP_VERSION_ID >= 80100 --TEMPLATE-- {% for c in enum_cases(13) %} {{~ c.name }} diff --git a/tests/Fixtures/functions/enum_cases/valid.test b/tests/Fixtures/functions/enum_cases/valid.test index a4ba3d3a5..ac78532cc 100644 --- a/tests/Fixtures/functions/enum_cases/valid.test +++ b/tests/Fixtures/functions/enum_cases/valid.test @@ -1,7 +1,5 @@ --TEST-- "enum_cases" function ---CONDITION-- -\PHP_VERSION_ID >= 80100 --TEMPLATE-- {% for c in enum_cases('Twig\\Tests\\DummyBackedEnum') %} {{~ c.name }}: {{ c.value }}