Skip to content

Commit

Permalink
Fix Twig deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
wouterj committed Dec 1, 2024
1 parent 3b2a3c7 commit 832f346
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/guides/src/Twig/AssetsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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]),
];
Expand Down

0 comments on commit 832f346

Please sign in to comment.