From 5caa6b62172ea7cbdac1dbe205f3c30662ff4526 Mon Sep 17 00:00:00 2001 From: Awilum Date: Fri, 1 Mar 2019 20:15:02 +0300 Subject: [PATCH] Flextype Slim Integration - next round of integration --- flextype/Cache.php | 1 - flextype/Plugins.php | 2 -- flextype/Themes.php | 2 -- flextype/twig/EmitterTwigExtension.php | 8 ++++++-- flextype/twig/EntriesTwigExtension.php | 8 ++++++-- flextype/twig/FlashTwigExtension.php | 4 ++-- 6 files changed, 14 insertions(+), 11 deletions(-) diff --git a/flextype/Cache.php b/flextype/Cache.php index 604750b2..803fa039 100755 --- a/flextype/Cache.php +++ b/flextype/Cache.php @@ -13,7 +13,6 @@ namespace Flextype; use Flextype\Component\Filesystem\Filesystem; -use Flextype\Component\Registry\Registry; use \Doctrine\Common\Cache as DoctrineCache; class Cache diff --git a/flextype/Plugins.php b/flextype/Plugins.php index 75e823cb..07c09cf8 100755 --- a/flextype/Plugins.php +++ b/flextype/Plugins.php @@ -13,9 +13,7 @@ namespace Flextype; use Flextype\Component\Filesystem\Filesystem; -use Flextype\Component\Event\Event; use Flextype\Component\I18n\I18n; -use Flextype\Component\Registry\Registry; class Plugins { diff --git a/flextype/Themes.php b/flextype/Themes.php index fda9e722..1802ed4b 100644 --- a/flextype/Themes.php +++ b/flextype/Themes.php @@ -13,8 +13,6 @@ namespace Flextype; use Flextype\Component\Filesystem\Filesystem; -use Flextype\Component\View\View; -use Flextype\Component\Registry\Registry; class Themes { diff --git a/flextype/twig/EmitterTwigExtension.php b/flextype/twig/EmitterTwigExtension.php index dc497471..87c03324 100644 --- a/flextype/twig/EmitterTwigExtension.php +++ b/flextype/twig/EmitterTwigExtension.php @@ -4,20 +4,24 @@ namespace Flextype; class EmitterTwigExtension extends \Twig_Extension { - /** * Flextype Dependency Container */ private $flextype; /** - * __construct + * Constructor */ public function __construct($flextype) { $this->flextype = $flextype; } + /** + * Callback for twig. + * + * @return array + */ public function getFunctions() { return [ diff --git a/flextype/twig/EntriesTwigExtension.php b/flextype/twig/EntriesTwigExtension.php index 9ddf66b7..f86e3dc4 100644 --- a/flextype/twig/EntriesTwigExtension.php +++ b/flextype/twig/EntriesTwigExtension.php @@ -4,20 +4,24 @@ namespace Flextype; class EntriesTwigExtension extends \Twig_Extension { - /** * Flextype Dependency Container */ private $flextype; /** - * __construct + * Constructor */ public function __construct($flextype) { $this->flextype = $flextype; } + /** + * Callback for twig. + * + * @return array + */ public function getFunctions() { return [ diff --git a/flextype/twig/FlashTwigExtension.php b/flextype/twig/FlashTwigExtension.php index 5bf35c3e..1476143b 100644 --- a/flextype/twig/FlashTwigExtension.php +++ b/flextype/twig/FlashTwigExtension.php @@ -6,14 +6,13 @@ use Slim\Flash\Messages; class FlashTwigExtension extends \Twig_Extension { - /** * Flextype Dependency Container */ private $flextype; /** - * Constructor. + * Constructor */ public function __construct($flextype) { @@ -44,6 +43,7 @@ class FlashTwigExtension extends \Twig_Extension if (null !== $key) { return $this->flextype['flash']->getMessage($key); } + return $this->flextype['flash']->getMessages(); } }