Skip to content

Commit

Permalink
Use TwigFunction instead of Twig_SimpleFunction
Browse files Browse the repository at this point in the history
  • Loading branch information
phansys committed Jan 17, 2018
1 parent 3519e4a commit be99547
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Twig/Extension/SonataAdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
use Twig\Template;
use Twig\TwigFilter;

Expand Down Expand Up @@ -112,8 +113,8 @@ public function getFilters()
public function getFunctions()
{
return [
new \Twig_SimpleFunction('canonicalize_locale_for_moment', [$this, 'getCanonicalizedLocaleForMoment'], ['needs_context' => true]),
new \Twig_SimpleFunction('canonicalize_locale_for_select2', [$this, 'getCanonicalizedLocaleForSelect2'], ['needs_context' => true]),
new TwigFunction('canonicalize_locale_for_moment', [$this, 'getCanonicalizedLocaleForMoment'], ['needs_context' => true]),
new TwigFunction('canonicalize_locale_for_select2', [$this, 'getCanonicalizedLocaleForSelect2'], ['needs_context' => true]),
];
}

Expand Down

0 comments on commit be99547

Please sign in to comment.