mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-30 20:16:45 +00:00
remove no longer needed PHP version checks
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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([
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) %}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user