mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-18 21:37:29 +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(
|
public function __construct(
|
||||||
private string $extensionName,
|
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
|
public function enterNode(Node $node, Environment $env): Node
|
||||||
|
|||||||
@@ -77,12 +77,10 @@ final class CallableArgumentsExtractor
|
|||||||
$pos = 0;
|
$pos = 0;
|
||||||
foreach ($callableParameters as $callableParameter) {
|
foreach ($callableParameters as $callableParameter) {
|
||||||
$name = $this->normalizeName($callableParameter->name);
|
$name = $this->normalizeName($callableParameter->name);
|
||||||
if (\PHP_VERSION_ID >= 80000 && 'range' === $callable) {
|
if ('range' === $callable && 'start' === $name) {
|
||||||
if ('start' === $name) {
|
$name = 'low';
|
||||||
$name = 'low';
|
} elseif ('range' === $callable && 'end' === $name) {
|
||||||
} elseif ('end' === $name) {
|
$name = 'high';
|
||||||
$name = 'high';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$names[] = $name;
|
$names[] = $name;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class ChainTest extends TestCase
|
|||||||
|
|
||||||
protected function setUp(): void
|
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->className = '__Twig_Tests_Cache_ChainTest_Template_'.$nonce;
|
||||||
$this->directory = sys_get_temp_dir().'/twig-test';
|
$this->directory = sys_get_temp_dir().'/twig-test';
|
||||||
$this->cache = new ChainCache([
|
$this->cache = new ChainCache([
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class ReadOnlyFilesystemTest extends TestCase
|
|||||||
|
|
||||||
protected function setUp(): void
|
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->className = '__Twig_Tests_Cache_ReadOnlyFilesystemTest_Template_'.$nonce;
|
||||||
$this->directory = sys_get_temp_dir().'/twig-test';
|
$this->directory = sys_get_temp_dir().'/twig-test';
|
||||||
$this->cache = new ReadOnlyFilesystemCache($this->directory);
|
$this->cache = new ReadOnlyFilesystemCache($this->directory);
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
--TEST--
|
--TEST--
|
||||||
"enum_cases" function with invalid dynamic enum class
|
"enum_cases" function with invalid dynamic enum class
|
||||||
--CONDITION--
|
|
||||||
\PHP_VERSION_ID >= 80100
|
|
||||||
--TEMPLATE--
|
--TEMPLATE--
|
||||||
{% set from_variable = 'Twig\\Tests\\NonExistentEnum' %}
|
{% set from_variable = 'Twig\\Tests\\NonExistentEnum' %}
|
||||||
{% for c in enum_cases(from_variable) %}
|
{% for c in enum_cases(from_variable) %}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
--TEST--
|
--TEST--
|
||||||
"enum_cases" function with invalid enum class
|
"enum_cases" function with invalid enum class
|
||||||
--CONDITION--
|
|
||||||
\PHP_VERSION_ID >= 80100
|
|
||||||
--TEMPLATE--
|
--TEMPLATE--
|
||||||
{% for c in enum_cases('Twig\\Tests\\NonExistentEnum') %}
|
{% for c in enum_cases('Twig\\Tests\\NonExistentEnum') %}
|
||||||
{{~ c.name }}
|
{{~ c.name }}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
--TEST--
|
--TEST--
|
||||||
"enum_cases" function with invalid literal type
|
"enum_cases" function with invalid literal type
|
||||||
--CONDITION--
|
|
||||||
\PHP_VERSION_ID >= 80100
|
|
||||||
--TEMPLATE--
|
--TEMPLATE--
|
||||||
{% for c in enum_cases(13) %}
|
{% for c in enum_cases(13) %}
|
||||||
{{~ c.name }}
|
{{~ c.name }}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
--TEST--
|
--TEST--
|
||||||
"enum_cases" function
|
"enum_cases" function
|
||||||
--CONDITION--
|
|
||||||
\PHP_VERSION_ID >= 80100
|
|
||||||
--TEMPLATE--
|
--TEMPLATE--
|
||||||
{% for c in enum_cases('Twig\\Tests\\DummyBackedEnum') %}
|
{% for c in enum_cases('Twig\\Tests\\DummyBackedEnum') %}
|
||||||
{{~ c.name }}: {{ c.value }}
|
{{~ c.name }}: {{ c.value }}
|
||||||
|
|||||||
Reference in New Issue
Block a user