diff --git a/resources/views/pages/login.twig b/resources/views/pages/login.twig
index d8a9bd4e..fdb5b116 100644
--- a/resources/views/pages/login.twig
+++ b/resources/views/pages/login.twig
@@ -17,7 +17,7 @@
(__('Event starts')): config('event_start'),
(__('Event ends')): config('event_end'),
(__('Teardown ends')): config('teardown_end')
- } if date %}
+ } | filter(date => date) %}
{% if date > date() %}
{{ name }}
diff --git a/src/Middleware/ErrorHandler.php b/src/Middleware/ErrorHandler.php
index b8f8b166..46e6e5a8 100644
--- a/src/Middleware/ErrorHandler.php
+++ b/src/Middleware/ErrorHandler.php
@@ -11,7 +11,7 @@ use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
-use Twig_LoaderInterface as TwigLoader;
+use Twig\Loader\LoaderInterface as TwigLoader;
class ErrorHandler implements MiddlewareInterface
{
diff --git a/src/Renderer/Twig/Extensions/Assets.php b/src/Renderer/Twig/Extensions/Assets.php
index 2cdfb0fd..b77e4755 100644
--- a/src/Renderer/Twig/Extensions/Assets.php
+++ b/src/Renderer/Twig/Extensions/Assets.php
@@ -3,8 +3,8 @@
namespace Engelsystem\Renderer\Twig\Extensions;
use Engelsystem\Http\UrlGenerator;
-use Twig_Extension as TwigExtension;
-use Twig_Function as TwigFunction;
+use Twig\Extension\AbstractExtension as TwigExtension;
+use Twig\TwigFunction;
class Assets extends TwigExtension
{
diff --git a/src/Renderer/Twig/Extensions/Authentication.php b/src/Renderer/Twig/Extensions/Authentication.php
index 538526da..33268ee6 100644
--- a/src/Renderer/Twig/Extensions/Authentication.php
+++ b/src/Renderer/Twig/Extensions/Authentication.php
@@ -3,8 +3,8 @@
namespace Engelsystem\Renderer\Twig\Extensions;
use Engelsystem\Helpers\Authenticator;
-use Twig_Extension as TwigExtension;
-use Twig_Function as TwigFunction;
+use Twig\Extension\AbstractExtension as TwigExtension;
+use Twig\TwigFunction;
class Authentication extends TwigExtension
{
diff --git a/src/Renderer/Twig/Extensions/Config.php b/src/Renderer/Twig/Extensions/Config.php
index dbbe93e7..a82d2f73 100644
--- a/src/Renderer/Twig/Extensions/Config.php
+++ b/src/Renderer/Twig/Extensions/Config.php
@@ -3,8 +3,8 @@
namespace Engelsystem\Renderer\Twig\Extensions;
use Engelsystem\Config\Config as EngelsystemConfig;
-use Twig_Extension as TwigExtension;
-use Twig_Function as TwigFunction;
+use Twig\Extension\AbstractExtension as TwigExtension;
+use Twig\TwigFunction;
class Config extends TwigExtension
{
diff --git a/src/Renderer/Twig/Extensions/Csrf.php b/src/Renderer/Twig/Extensions/Csrf.php
index 9f77df80..6e326824 100644
--- a/src/Renderer/Twig/Extensions/Csrf.php
+++ b/src/Renderer/Twig/Extensions/Csrf.php
@@ -3,8 +3,8 @@
namespace Engelsystem\Renderer\Twig\Extensions;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
-use Twig_Extension as TwigExtension;
-use Twig_Function as TwigFunction;
+use Twig\Extension\AbstractExtension as TwigExtension;
+use Twig\TwigFunction;
class Csrf extends TwigExtension
{
diff --git a/src/Renderer/Twig/Extensions/Globals.php b/src/Renderer/Twig/Extensions/Globals.php
index ef29a819..a7914623 100644
--- a/src/Renderer/Twig/Extensions/Globals.php
+++ b/src/Renderer/Twig/Extensions/Globals.php
@@ -3,8 +3,8 @@
namespace Engelsystem\Renderer\Twig\Extensions;
use Engelsystem\Helpers\Authenticator;
-use Twig_Extension as TwigExtension;
-use Twig_Extension_GlobalsInterface as GlobalsInterface;
+use Twig\Extension\AbstractExtension as TwigExtension;
+use Twig\Extension\GlobalsInterface as GlobalsInterface;
class Globals extends TwigExtension implements GlobalsInterface
{
diff --git a/src/Renderer/Twig/Extensions/Legacy.php b/src/Renderer/Twig/Extensions/Legacy.php
index 55c095fc..41b00468 100644
--- a/src/Renderer/Twig/Extensions/Legacy.php
+++ b/src/Renderer/Twig/Extensions/Legacy.php
@@ -3,8 +3,8 @@
namespace Engelsystem\Renderer\Twig\Extensions;
use Engelsystem\Http\Request;
-use Twig_Extension as TwigExtension;
-use Twig_Function as TwigFunction;
+use Twig\Extension\AbstractExtension as TwigExtension;
+use Twig\TwigFunction;
class Legacy extends TwigExtension
{
diff --git a/src/Renderer/Twig/Extensions/Markdown.php b/src/Renderer/Twig/Extensions/Markdown.php
index 293efe91..3d523f57 100644
--- a/src/Renderer/Twig/Extensions/Markdown.php
+++ b/src/Renderer/Twig/Extensions/Markdown.php
@@ -3,8 +3,8 @@
namespace Engelsystem\Renderer\Twig\Extensions;
use Parsedown;
-use Twig_Extension as TwigExtension;
-use Twig_Filter as TwigFilter;
+use Twig\Extension\AbstractExtension as TwigExtension;
+use Twig\TwigFilter;
class Markdown extends TwigExtension
{
diff --git a/src/Renderer/Twig/Extensions/Session.php b/src/Renderer/Twig/Extensions/Session.php
index 4690f701..378e977e 100644
--- a/src/Renderer/Twig/Extensions/Session.php
+++ b/src/Renderer/Twig/Extensions/Session.php
@@ -3,8 +3,8 @@
namespace Engelsystem\Renderer\Twig\Extensions;
use Symfony\Component\HttpFoundation\Session\Session as SymfonySession;
-use Twig_Extension as TwigExtension;
-use Twig_Function as TwigFunction;
+use Twig\Extension\AbstractExtension as TwigExtension;
+use Twig\TwigFunction;
class Session extends TwigExtension
{
diff --git a/src/Renderer/Twig/Extensions/Translation.php b/src/Renderer/Twig/Extensions/Translation.php
index 929310a1..63b6fa5e 100644
--- a/src/Renderer/Twig/Extensions/Translation.php
+++ b/src/Renderer/Twig/Extensions/Translation.php
@@ -3,9 +3,9 @@
namespace Engelsystem\Renderer\Twig\Extensions;
use Engelsystem\Helpers\Translation\Translator;
-use Twig_Extension as TwigExtension;
-use Twig_Filter as TwigFilter;
-use Twig_Function as TwigFunction;
+use Twig\Extension\AbstractExtension as TwigExtension;
+use Twig\TwigFilter;
+use Twig\TwigFunction;
class Translation extends TwigExtension
{
diff --git a/src/Renderer/Twig/Extensions/Url.php b/src/Renderer/Twig/Extensions/Url.php
index 62e59782..84c6aa4d 100644
--- a/src/Renderer/Twig/Extensions/Url.php
+++ b/src/Renderer/Twig/Extensions/Url.php
@@ -3,8 +3,8 @@
namespace Engelsystem\Renderer\Twig\Extensions;
use Engelsystem\Http\UrlGenerator;
-use Twig_Extension as TwigExtension;
-use Twig_Function as TwigFunction;
+use Twig\Extension\AbstractExtension as TwigExtension;
+use Twig\TwigFunction;
class Url extends TwigExtension
{
diff --git a/src/Renderer/TwigEngine.php b/src/Renderer/TwigEngine.php
index aa51a177..2c77e54f 100644
--- a/src/Renderer/TwigEngine.php
+++ b/src/Renderer/TwigEngine.php
@@ -2,10 +2,10 @@
namespace Engelsystem\Renderer;
-use Twig_Environment as Twig;
-use Twig_Error_Loader as LoaderError;
-use Twig_Error_Runtime as RuntimeError;
-use Twig_Error_Syntax as SyntaxError;
+use Twig\Environment as Twig;
+use Twig\Error\LoaderError as LoaderError;
+use Twig\Error\RuntimeError as RuntimeError;
+use Twig\Error\SyntaxError as SyntaxError;
class TwigEngine extends Engine
{
diff --git a/src/Renderer/TwigLoader.php b/src/Renderer/TwigLoader.php
index f20a8764..3c4c8ab8 100644
--- a/src/Renderer/TwigLoader.php
+++ b/src/Renderer/TwigLoader.php
@@ -2,16 +2,16 @@
namespace Engelsystem\Renderer;
-use Twig_Error_Loader;
-use Twig_Loader_Filesystem as FilesystemLoader;
+use Twig\Error\LoaderError as ErrorLoader;
+use Twig\Loader\FilesystemLoader as FilesystemLoader;
class TwigLoader extends FilesystemLoader
{
/**
* @param string $name
* @param bool $throw
- * @return false|string
- * @throws Twig_Error_Loader
+ * @return string|false|null
+ * @throws ErrorLoader
*/
public function findTemplate($name, $throw = true)
{
diff --git a/src/Renderer/TwigServiceProvider.php b/src/Renderer/TwigServiceProvider.php
index 6cd885fd..3a365a5e 100644
--- a/src/Renderer/TwigServiceProvider.php
+++ b/src/Renderer/TwigServiceProvider.php
@@ -14,9 +14,9 @@ use Engelsystem\Renderer\Twig\Extensions\Markdown;
use Engelsystem\Renderer\Twig\Extensions\Session;
use Engelsystem\Renderer\Twig\Extensions\Translation;
use Engelsystem\Renderer\Twig\Extensions\Url;
-use Twig_Environment as Twig;
-use Twig_Extension_Core as TwigCore;
-use Twig_LoaderInterface as TwigLoaderInterface;
+use Twig\Environment as Twig;
+use Twig\Extension\CoreExtension as TwigCore;
+use Twig\Loader\LoaderInterface as TwigLoaderInterface;
class TwigServiceProvider extends ServiceProvider
{
diff --git a/tests/Unit/Middleware/ErrorHandlerTest.php b/tests/Unit/Middleware/ErrorHandlerTest.php
index 6ae604e0..ef2f7be0 100644
--- a/tests/Unit/Middleware/ErrorHandlerTest.php
+++ b/tests/Unit/Middleware/ErrorHandlerTest.php
@@ -19,7 +19,7 @@ use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
-use Twig_LoaderInterface as TwigLoader;
+use Twig\Loader\LoaderInterface as TwigLoader;
class ErrorHandlerTest extends TestCase
{
diff --git a/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php b/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php
index 921a06a3..3d7cea12 100644
--- a/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php
+++ b/tests/Unit/Renderer/Twig/Extensions/ExtensionTest.php
@@ -6,8 +6,8 @@ use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts;
use Exception;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
-use Twig_Function as TwigFunction;
-use Twig_Node as TwigNode;
+use Twig\TwigFunction;
+use Twig\Node\Node as TwigNode;
abstract class ExtensionTest extends TestCase
{
diff --git a/tests/Unit/Renderer/TwigEngineTest.php b/tests/Unit/Renderer/TwigEngineTest.php
index 5e5e59d9..8798d0ff 100644
--- a/tests/Unit/Renderer/TwigEngineTest.php
+++ b/tests/Unit/Renderer/TwigEngineTest.php
@@ -5,8 +5,8 @@ namespace Engelsystem\Test\Unit\Renderer;
use Engelsystem\Renderer\TwigEngine;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
-use Twig_Environment as Twig;
-use Twig_LoaderInterface as LoaderInterface;
+use Twig\Environment as Twig;
+use Twig\Loader\LoaderInterface as LoaderInterface;
class TwigEngineTest extends TestCase
{
diff --git a/tests/Unit/Renderer/TwigServiceProviderTest.php b/tests/Unit/Renderer/TwigServiceProviderTest.php
index cd071349..7696d28f 100644
--- a/tests/Unit/Renderer/TwigServiceProviderTest.php
+++ b/tests/Unit/Renderer/TwigServiceProviderTest.php
@@ -11,10 +11,10 @@ use PHPUnit\Framework\MockObject\MockObject;
use ReflectionClass as Reflection;
use ReflectionException;
use stdClass;
-use Twig_Environment as Twig;
-use Twig_Extension_Core as TwigCore;
-use Twig_ExtensionInterface as ExtensionInterface;
-use Twig_LoaderInterface as TwigLoaderInterface;
+use Twig\Environment as Twig;
+use Twig\Extension\CoreExtension as TwigCore;
+use Twig\Extension\ExtensionInterface as ExtensionInterface;
+use Twig\Loader\LoaderInterface as TwigLoaderInterface;
class TwigServiceProviderTest extends ServiceProviderTest
{