diff --git a/composer.json b/composer.json index a5cd592..ce3e85b 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "php": "^8.1", "composer-plugin-api": "^2.0", "codefog/contao-haste": "^5.2", - "contao/core-bundle": "^4.13.50 || ^5.3.14 || ^5.4.4", + "contao/core-bundle": "^4.13.50 || ~5.3.14 || ^5.4.4", "doctrine/dbal": "^3.4", "doctrine/orm": "^2.19", "knplabs/knp-menu": "^3.1", diff --git a/src/ContaoManager/Plugin.php b/src/ContaoManager/Plugin.php index 64257a6..4fbfb10 100644 --- a/src/ContaoManager/Plugin.php +++ b/src/ContaoManager/Plugin.php @@ -11,6 +11,7 @@ use Contao\ManagerPlugin\Routing\RoutingPluginInterface; use Symfony\Component\Config\Loader\LoaderResolverInterface; use Symfony\Component\HttpKernel\KernelInterface; +use Terminal42\NotificationCenterBundle\Controller\DownloadBulkyItemController; use Terminal42\NotificationCenterBundle\Terminal42NotificationCenterBundle; class Plugin implements BundlePluginInterface, RoutingPluginInterface @@ -27,8 +28,8 @@ public function getBundles(ParserInterface $parser): array public function getRouteCollection(LoaderResolverInterface $resolver, KernelInterface $kernel) { return $resolver - ->resolve(__DIR__.'/../Controller/DownloadBulkyItemController.php', 'attribute') - ->load(__DIR__.'/../Controller/DownloadBulkyItemController.php') + ->resolve(DownloadBulkyItemController::class) + ->load(DownloadBulkyItemController::class) ; } } diff --git a/src/Controller/DownloadBulkyItemController.php b/src/Controller/DownloadBulkyItemController.php index d038ef0..06a9cb8 100644 --- a/src/Controller/DownloadBulkyItemController.php +++ b/src/Controller/DownloadBulkyItemController.php @@ -9,10 +9,12 @@ use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\HttpFoundation\UriSigner; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; -use Symfony\Component\Routing\Attribute\Route; +use Symfony\Component\Routing\Annotation\Route; use Terminal42\NotificationCenterBundle\BulkyItem\BulkyItemStorage; -#[Route('/notifications/download/{voucher}', 'nc_bulky_item_download', requirements: ['voucher' => BulkyItemStorage::VOUCHER_REGEX])] +/** + * @Route("/notifications/download/{voucher}", name="nc_bulky_item_download", requirements={"voucher"=BulkyItemStorage::VOUCHER_REGEX}) + */ class DownloadBulkyItemController { public function __construct(