Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 76e80d7

Browse filesBrowse files
committed
use DeprecatedCallableInfo for Twig callables if possible
1 parent adc87ad commit 76e80d7
Copy full SHA for 76e80d7

File tree

1 file changed

+7
-1
lines changed
Filter options

1 file changed

+7
-1
lines changed

‎src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Tests/Command/LintCommandTest.php
+7-1Lines 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;
@@ -163,9 +164,14 @@ private function createCommandTester(): CommandTester
163164
private function createCommand(): Command
164165
{
165166
$environment = new Environment(new FilesystemLoader(\dirname(__DIR__).'/Fixtures/templates/'));
167+
if (class_exists(DeprecatedCallableInfo::class)) {
168+
$options = ['deprecation_info' => new DeprecatedCallableInfo('foo/bar', '1.1')];
169+
} else {
170+
$options = ['deprecated' => true];
171+
}
166172
$environment->addFilter(new TwigFilter('deprecated_filter', function ($v) {
167173
return $v;
168-
}, ['deprecated' => true]));
174+
}, $options));
169175

170176
$command = new LintCommand($environment);
171177

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.