aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Twig/WallabagExtension.php
diff options
context:
space:
mode:
authorJérémy Benoist <j0k3r@users.noreply.github.com>2019-06-24 07:30:35 +0200
committerGitHub <noreply@github.com>2019-06-24 07:30:35 +0200
commitcdf458722df80cfeeafab1806da1f6b9a71409d1 (patch)
tree4df7d02bebed40cc954911647409227392e7805c /src/Wallabag/CoreBundle/Twig/WallabagExtension.php
parent8bfcb20f657e46307e08c4fda9e7cd99ba164931 (diff)
parentac5844a68e6384af447c67d9e5638795a02c9d99 (diff)
downloadwallabag-cdf458722df80cfeeafab1806da1f6b9a71409d1.tar.gz
wallabag-cdf458722df80cfeeafab1806da1f6b9a71409d1.tar.zst
wallabag-cdf458722df80cfeeafab1806da1f6b9a71409d1.zip
Merge pull request #4024 from wallabag/update-deps
Update deps
Diffstat (limited to 'src/Wallabag/CoreBundle/Twig/WallabagExtension.php')
-rw-r--r--src/Wallabag/CoreBundle/Twig/WallabagExtension.php23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php
index 536185d4..02f17f50 100644
--- a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php
+++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php
@@ -4,10 +4,14 @@ namespace Wallabag\CoreBundle\Twig;
4 4
5use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; 5use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
6use Symfony\Component\Translation\TranslatorInterface; 6use Symfony\Component\Translation\TranslatorInterface;
7use Twig\Extension\AbstractExtension;
8use Twig\Extension\GlobalsInterface;
9use Twig\TwigFilter;
10use Twig\TwigFunction;
7use Wallabag\CoreBundle\Repository\EntryRepository; 11use Wallabag\CoreBundle\Repository\EntryRepository;
8use Wallabag\CoreBundle\Repository\TagRepository; 12use Wallabag\CoreBundle\Repository\TagRepository;
9 13
10class WallabagExtension extends \Twig_Extension implements \Twig_Extension_GlobalsInterface 14class WallabagExtension extends AbstractExtension implements GlobalsInterface
11{ 15{
12 private $tokenStorage; 16 private $tokenStorage;
13 private $entryRepository; 17 private $entryRepository;
@@ -24,21 +28,26 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa
24 $this->translator = $translator; 28 $this->translator = $translator;
25 } 29 }
26 30
31 public function getGlobals()
32 {
33 return [];
34 }
35
27 public function getFilters() 36 public function getFilters()
28 { 37 {
29 return [ 38 return [
30 new \Twig_SimpleFilter('removeWww', [$this, 'removeWww']), 39 new TwigFilter('removeWww', [$this, 'removeWww']),
31 new \Twig_SimpleFilter('removeScheme', [$this, 'removeScheme']), 40 new TwigFilter('removeScheme', [$this, 'removeScheme']),
32 new \Twig_SimpleFilter('removeSchemeAndWww', [$this, 'removeSchemeAndWww']), 41 new TwigFilter('removeSchemeAndWww', [$this, 'removeSchemeAndWww']),
33 ]; 42 ];
34 } 43 }
35 44
36 public function getFunctions() 45 public function getFunctions()
37 { 46 {
38 return [ 47 return [
39 new \Twig_SimpleFunction('count_entries', [$this, 'countEntries']), 48 new TwigFunction('count_entries', [$this, 'countEntries']),
40 new \Twig_SimpleFunction('count_tags', [$this, 'countTags']), 49 new TwigFunction('count_tags', [$this, 'countTags']),
41 new \Twig_SimpleFunction('display_stats', [$this, 'displayStats']), 50 new TwigFunction('display_stats', [$this, 'displayStats']),
42 ]; 51 ];
43 } 52 }
44 53