diff --git a/.gitignore b/.gitignore index 57872d0..3a9875b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /vendor/ +composer.lock 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/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"))), ); } diff --git a/composer.json b/composer.json index bc7c298..ea4c13b 100644 --- a/composer.json +++ b/composer.json @@ -13,14 +13,14 @@ ], "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": "*" }, "autoload": { - "psr-0": { "APY\\BreadcrumbTrailBundle": "" } + "psr-4": { "APY\\BreadcrumbTrailBundle\\": "" } }, "target-dir": "APY/BreadcrumbTrailBundle" }