28
28
use Psr \Log \LoggerInterface ;
29
29
use RuntimeException ;
30
30
use Stringable ;
31
+ use Twig \DeprecatedCallableInfo ;
31
32
use Twig \Extension \AbstractExtension ;
32
33
use Twig \TwigFunction ;
33
34
use Twig \TwigTest ;
34
35
36
+ use function class_exists ;
35
37
use function sprintf ;
36
38
use function trim ;
37
39
@@ -57,7 +59,11 @@ public function getFunctions(): array
57
59
new TwigFunction ('renderNode ' , $ this ->renderNode (...), ['is_safe ' => ['html ' ], 'needs_context ' => true ]),
58
60
new TwigFunction ('renderLink ' , $ this ->renderLink (...), ['is_safe ' => ['html ' ], 'needs_context ' => true ]),
59
61
new TwigFunction ('renderBreadcrumb ' , $ this ->renderBreadcrumb (...), ['is_safe ' => ['html ' ], 'needs_context ' => true ]),
60
- new TwigFunction ('renderMenu ' , $ this ->renderMenu (...), ['is_safe ' => ['html ' ], 'needs_context ' => true , 'deprecated ' => true ]),
62
+ new TwigFunction (
63
+ 'renderMenu ' ,
64
+ $ this ->renderMenu (...),
65
+ ['is_safe ' => ['html ' ], 'needs_context ' => true ] + (class_exists (DeprecatedCallableInfo::class) ? ['deprecation_info ' => new DeprecatedCallableInfo ('phpdocumentor/guides ' , '1.1.0 ' , 'renderMenu" from " ' . GlobalMenuExtension::class)] : ['deprecated ' => true ]),
66
+ ),
61
67
new TwigFunction ('renderTarget ' , $ this ->renderTarget (...), ['is_safe ' => ['html ' ], 'needs_context ' => true ]),
62
68
new TwigFunction ('renderOrderedListType ' , $ this ->renderOrderedListType (...), ['is_safe ' => ['html ' ], 'needs_context ' => false ]),
63
69
];
0 commit comments