diff --git a/Twig/MenuExtension.php b/Twig/MenuExtension.php index 3fe0ab7..842b9bc 100644 --- a/Twig/MenuExtension.php +++ b/Twig/MenuExtension.php @@ -19,13 +19,15 @@ use Pd\MenuBundle\Render\RenderInterface; use Psr\Container\ContainerInterface; use Symfony\Component\Translation\TranslatorInterface; +use Twig\Extension\AbstractExtension; +use Twig\TwigFunction; /** * Menu Twig Extension. * * @author Kerem APAYDIN */ -class MenuExtension extends \Twig_Extension +class MenuExtension extends AbstractExtension { /** * @var RenderInterface @@ -77,14 +79,14 @@ public function __construct(RenderInterface $engine, ItemProcessInterface $itemP /** * Create Twig Function. * - * @return array|\Twig_Function[] + * @return array */ public function getFunctions() { return [ - new \Twig_SimpleFunction('pd_menu_render', [$this, 'renderMenu'], ['is_safe' => ['html']]), - new \Twig_SimpleFunction('pd_menu_get', [$this, 'getMenu']), - new \Twig_SimpleFunction('arrayToAttr', [$this, 'arrayToAttr'], ['is_safe' => ['html']]), + new TwigFunction('pd_menu_render', [$this, 'renderMenu'], ['is_safe' => ['html']]), + new TwigFunction('pd_menu_get', [$this, 'getMenu']), + new TwigFunction('arrayToAttr', [$this, 'arrayToAttr'], ['is_safe' => ['html']]), ]; }