File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/Symfony/Bridge/Twig/Tests/Command Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 18
18
use Symfony \Component \Console \Output \OutputInterface ;
19
19
use Symfony \Component \Console \Tester \CommandCompletionTester ;
20
20
use Symfony \Component \Console \Tester \CommandTester ;
21
+ use Twig \DeprecatedCallableInfo ;
21
22
use Twig \Environment ;
22
23
use Twig \Loader \FilesystemLoader ;
23
24
use Twig \TwigFilter ;
@@ -163,9 +164,14 @@ private function createCommandTester(): CommandTester
163
164
private function createCommand (): Command
164
165
{
165
166
$ 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
+ }
166
172
$ environment ->addFilter (new TwigFilter ('deprecated_filter ' , function ($ v ) {
167
173
return $ v ;
168
- }, [ ' deprecated ' => true ] ));
174
+ }, $ options ));
169
175
170
176
$ command = new LintCommand ($ environment );
171
177
You can’t perform that action at this time.
0 commit comments