From 1943239fa1404852438342f6554d5ee3fa5378d9 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 20 May 2019 01:01:08 +0100 Subject: [PATCH] Fix deprecations in TalksExtension Fixes #66 --- src/Talks/src/TwigExtension/TalksExtension.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Talks/src/TwigExtension/TalksExtension.php b/src/Talks/src/TwigExtension/TalksExtension.php index ddd993be..4790f31f 100644 --- a/src/Talks/src/TwigExtension/TalksExtension.php +++ b/src/Talks/src/TwigExtension/TalksExtension.php @@ -2,14 +2,13 @@ namespace App\Talks\TwigExtension; -use Illuminate\Support\Collection; use Sculpin\Contrib\ProxySourceCollection\ProxySourceCollection; -use Twig_Extension; use Tightenco\Collect\Support\Collection; +use Twig\Extension\AbstractExtension; use Twig\TwigFilter; -use Twig_SimpleFunction; +use Twig\TwigFunction; -class TalksExtension extends Twig_Extension +class TalksExtension extends AbstractExtension { /** * @var string The current date. @@ -30,9 +29,9 @@ class TalksExtension extends Twig_Extension public function getFunctions() { return [ - new Twig_SimpleFunction('getAllTalks', [$this, 'getAll']), - new Twig_SimpleFunction('getUpcomingTalks', [$this, 'getUpcoming']), - new Twig_SimpleFunction('getPastTalks', [$this, 'getPast']), + new TwigFunction('getAllTalks', [$this, 'getAll']), + new TwigFunction('getUpcomingTalks', [$this, 'getUpcoming']), + new TwigFunction('getPastTalks', [$this, 'getPast']), ]; }