From 3179193afaef438b7542257c5e83730c9ddbf730 Mon Sep 17 00:00:00 2001 From: Maxime Pinot Date: Mon, 30 Dec 2019 17:22:56 +0100 Subject: [PATCH 1/3] Allow Symfony 5 --- EventListener/BreadcrumbListener.php | 6 +++--- composer.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/EventListener/BreadcrumbListener.php b/EventListener/BreadcrumbListener.php index 86dcb1f..62e93b2 100644 --- a/EventListener/BreadcrumbListener.php +++ b/EventListener/BreadcrumbListener.php @@ -12,9 +12,9 @@ namespace APY\BreadcrumbTrailBundle\EventListener; use Doctrine\Common\Annotations\Reader; -use Symfony\Component\HttpKernel\Event\FilterControllerEvent; use APY\BreadcrumbTrailBundle\BreadcrumbTrail\Trail; use APY\BreadcrumbTrailBundle\Annotation\Breadcrumb; +use Symfony\Component\HttpKernel\Event\KernelEvent; use Symfony\Component\HttpKernel\HttpKernelInterface; class BreadcrumbListener @@ -43,9 +43,9 @@ public function __construct(Reader $reader, Trail $breadcrumbTrail) } /** - * @param FilterControllerEvent $event A FilterControllerEvent instance + * @param \Symfony\Component\HttpKernel\Event\FilterControllerEvent|\Symfony\Component\HttpKernel\Event\ControllerEvent $event */ - public function onKernelController(FilterControllerEvent $event) + public function onKernelController(KernelEvent $event) { if (!is_array($controller = $event->getController())) { return; diff --git a/composer.json b/composer.json index bc7c298..073cdec 100644 --- a/composer.json +++ b/composer.json @@ -13,8 +13,8 @@ ], "require": { "php": ">=5.3.3", - "symfony/framework-bundle": "^2.3|^3.0|^4.0", - "twig/twig": "^1.41|^2.0" + "symfony/framework-bundle": "^2.3|^3.0|^4.0|^5.0", + "twig/twig": "^1.41|^2.0|^3.0" }, "suggest": { "ext-intl": "*" From 3096759ef5114b88d5f7f4a51077a10b36049b72 Mon Sep 17 00:00:00 2001 From: Richard van Laak Date: Tue, 9 Jun 2020 11:38:52 +0200 Subject: [PATCH 2/3] fix Twig deprecation --- Twig/BreadcrumbTrailExtension.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Twig/BreadcrumbTrailExtension.php b/Twig/BreadcrumbTrailExtension.php index 8d132da..7018f0a 100644 --- a/Twig/BreadcrumbTrailExtension.php +++ b/Twig/BreadcrumbTrailExtension.php @@ -14,6 +14,7 @@ use APY\BreadcrumbTrailBundle\BreadcrumbTrail\Trail; use Twig\Environment; use Twig\Extension\AbstractExtension; +use Twig\TwigFunction; /** * Provides an extension for Twig to output breadcrumbs @@ -43,7 +44,7 @@ public function __construct(Trail $trail, Environment $templating) public function getFunctions() { return array( - new \Twig_SimpleFunction("apy_breadcrumb_trail_render", array($this, "renderBreadcrumbTrail"), array("is_safe" => array("html"))), + new TwigFunction("apy_breadcrumb_trail_render", array($this, "renderBreadcrumbTrail"), array("is_safe" => array("html"))), ); } From c27935d59aef270cd77536ad88ad454a13ae1a97 Mon Sep 17 00:00:00 2001 From: Richard van Laak Date: Tue, 9 Jun 2020 11:39:07 +0200 Subject: [PATCH 3/3] fix autoload path --- .gitignore | 1 + composer.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 57872d0..3a9875b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /vendor/ +composer.lock diff --git a/composer.json b/composer.json index 073cdec..ea4c13b 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "ext-intl": "*" }, "autoload": { - "psr-0": { "APY\\BreadcrumbTrailBundle": "" } + "psr-4": { "APY\\BreadcrumbTrailBundle\\": "" } }, "target-dir": "APY/BreadcrumbTrailBundle" }