File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1818use Symfony \Component \Console \Output \OutputInterface ;
1919use Symfony \Component \Console \Tester \CommandCompletionTester ;
2020use Symfony \Component \Console \Tester \CommandTester ;
21+ use Twig \DeprecatedCallableInfo ;
2122use Twig \Environment ;
2223use Twig \Loader \FilesystemLoader ;
2324use 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
You can’t perform that action at this time.
0 commit comments