diff --git a/packages/guides/src/Twig/AssetsExtension.php b/packages/guides/src/Twig/AssetsExtension.php index 1bcb3fee3..8d67de1e6 100644 --- a/packages/guides/src/Twig/AssetsExtension.php +++ b/packages/guides/src/Twig/AssetsExtension.php @@ -28,10 +28,12 @@ use Psr\Log\LoggerInterface; use RuntimeException; use Stringable; +use Twig\DeprecatedCallableInfo; use Twig\Extension\AbstractExtension; use Twig\TwigFunction; use Twig\TwigTest; +use function class_exists; use function sprintf; use function trim; @@ -57,7 +59,11 @@ public function getFunctions(): array new TwigFunction('renderNode', $this->renderNode(...), ['is_safe' => ['html'], 'needs_context' => true]), new TwigFunction('renderLink', $this->renderLink(...), ['is_safe' => ['html'], 'needs_context' => true]), new TwigFunction('renderBreadcrumb', $this->renderBreadcrumb(...), ['is_safe' => ['html'], 'needs_context' => true]), - new TwigFunction('renderMenu', $this->renderMenu(...), ['is_safe' => ['html'], 'needs_context' => true, 'deprecated' => true]), + new TwigFunction( + 'renderMenu', + $this->renderMenu(...), + ['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]), + ), new TwigFunction('renderTarget', $this->renderTarget(...), ['is_safe' => ['html'], 'needs_context' => true]), new TwigFunction('renderOrderedListType', $this->renderOrderedListType(...), ['is_safe' => ['html'], 'needs_context' => false]), ];