Skip to content

Commit 09c0df1

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: [Intl] Update ICU data from 74.1 to 75.1 use DeprecatedCallableInfo for Twig callables if possible [Filesystem] Add a warning about `chown()` and `chgrp()` on Windows [String] Update wcswidth data with Unicode 16 Work around parse_url() bug [Ldap] Clean `ldap_connect()` call in `LdapTestCase` [HttpFoundation] Update links for X-Accel-Redirect and fail properly when X-Accel-Mapping is missing
2 parents bb2375d + d049fbe commit 09c0df1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Tests/Command/LintCommandTest.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Symfony\Component\Console\Output\OutputInterface;
1919
use Symfony\Component\Console\Tester\CommandCompletionTester;
2020
use Symfony\Component\Console\Tester\CommandTester;
21+
use Twig\DeprecatedCallableInfo;
2122
use Twig\Environment;
2223
use Twig\Loader\FilesystemLoader;
2324
use Twig\TwigFilter;
@@ -159,7 +160,12 @@ private function createCommandTester(): CommandTester
159160
private function createCommand(): Command
160161
{
161162
$environment = new Environment(new FilesystemLoader(\dirname(__DIR__).'/Fixtures/templates/'));
162-
$environment->addFilter(new TwigFilter('deprecated_filter', fn ($v) => $v, ['deprecated' => true]));
163+
if (class_exists(DeprecatedCallableInfo::class)) {
164+
$options = ['deprecation_info' => new DeprecatedCallableInfo('foo/bar', '1.1')];
165+
} else {
166+
$options = ['deprecated' => true];
167+
}
168+
$environment->addFilter(new TwigFilter('deprecated_filter', fn ($v) => $v, $options));
163169

164170
$command = new LintCommand($environment);
165171

0 commit comments

Comments
 (0)