Skip to content

Commit

Permalink
Fixed Deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
cesurapp committed Mar 16, 2019
1 parent e594fa4 commit 3c48ec9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Twig/MenuExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
*/
class MenuExtension extends \Twig_Extension
class MenuExtension extends AbstractExtension
{
/**
* @var RenderInterface
Expand Down Expand Up @@ -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']]),
];
}

Expand Down

0 comments on commit 3c48ec9

Please sign in to comment.